Beste mensen, ik heb een array, maar weet even niet hoe ik deze kan uitlezen (zonder print_r). Want ik wil er divs omheen bouwen, wil de title en de sources gebruiken, en maximaal 5 weergeven.
Code:Array ( [0] => Array ( [title] => Qualcomm Shipped Most Smartphone and Tablet GPUs in 2011 [date] => 3 hours ago [sources] => http://www.pcper.com/news/Mobile/Qualcomm-Shipped-Most-Smartphone-and-Tablet-GPUs-2011 ) [1] => Array ( [title] => CRISIL assigns 3/5 grade to Tribhovandas Bhimji IPO [date] => 12 hours ago [sources] => http://www.moneycontrol.com/news/ipo-upcoming-issues/crisil-assigns-35-grade-to-tribhovandas-bhimji-ipo_673060.html ) [2] => Array ( [title] => Looks like telecom penetration has peaked [date] => 14 hours ago [sources] => http://www.dnaindia.com/money/report_looks-like-telecom-penetration-has-peaked_1654424 ) [3] => Array ( [title] => ReportsnReports: Global Markets, Technologies and Materials for Thin and ... [date] => 17 hours ago [sources] => http://www.prsafe.com/new_press_releases/view/6544 ) [4] => Array ( [title] => Goldmine in family silver [date] => 21 hours ago [sources] => http://www.mydigitalfc.com/news/goldmine-family-silver-552 ) [5] => Array ( [title] => Plastic Packaging Industry Globally and in China Examined in New Report ... [date] => Feb 24, 2012 [sources] => http://www.sfgate.com/cgi-bin/article.cgi?f=/g/a/2012/02/24/prweb9225391.DTL ) [6] => Array ( [title] => Research and Markets: United Arab Emirates Consumer Electronics Report Q1 2012 ... [date] => Feb 24, 2012 [sources] => http://www.sunherald.com/2012/02/24/3774453/research-and-markets-united-arab.html ) }
- Array uitlezen
-
25-02-2012, 17:50 #1
- Berichten
- 419
- Lid sinds
- 16 Jaar
Array uitlezen
-
-
25-02-2012, 18:07 #2gast9732 Guest
Re: Array uitlezen
echo?
-
25-02-2012, 18:13 #3
- Berichten
- 419
- Lid sinds
- 16 Jaar
Re: Array uitlezen
Ja, via echo maar hoe ...
-
25-02-2012, 18:18 #4
- Berichten
- 289
- Lid sinds
- 14 Jaar
Re: Array uitlezen
$var[0]["title"] == "Qualcomm Shipped Most Smartphone and Tablet GPUs in 2011"
-
25-02-2012, 18:30 #5
- Berichten
- 45
- Lid sinds
- 14 Jaar
Re: Array uitlezen
PHP Code:<?php
while ($sql = mysql_fetch_array($query)) {
echo $sql[title];
echo $sql[date];
echo $sql[sources];
}
?>
-
27-02-2012, 07:22 #6
- Berichten
- 277
- Lid sinds
- 17 Jaar
Re: Array uitlezen
PHP Code:<?php
foreach($arrayNaam as $data)
{
?>
<div><?php echo $data['titel']; ?></div>
<div><?php ech $data['prijs']; ?></div>
<div><?pph echo $data['etc']; ?></div>
<?php
}
?>
-
27-02-2012, 08:00 #7
- Berichten
- 1.470
- Lid sinds
- 19 Jaar
Re: Array uitlezen
for($i = 0; $i != 6; $i++){
echo $array[$i]['title'];
}
Plaats een
- + Advertentie
- + Onderwerp
Marktplaats
Webmasterforum
- Websites algemeen
- Sitechecks
- Marketing
- Domeinen algemeen
- Waardebepaling
- CMS
- Wordpress
- Joomla
- Magento
- Google algemeen
- SEO
- Analytics
- Adsense
- Adwords
- HTML / XHTML
- CSS
- Programmeren
- PHP
- Javascript
- JQuery
- MySQL
- Ondernemen algemeen
- Belastingen
- Juridisch
- Grafisch ontwerp
- Hosting Algemeen
- Hardware Info
- Offtopic