[SOLVED] Printf mistake ?

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

User avatar
n00b Saibot
DevNet Resident
Posts: 1452
Joined: Fri Dec 24, 2004 2:59 am
Location: Lucknow, UP, India
Contact:

Post by n00b Saibot »

u can use like this

Code: Select all

foreach ($location as $loc)
echo "results for $w_naam held $w_naam at $loc";
See if that helps ya
Robert Plank
Forum Contributor
Posts: 110
Joined: Sun Dec 26, 2004 9:04 pm
Contact:

Post by Robert Plank »

Code: Select all

reset($w_naam);
reset($w_datum);
reset($w_plaats);

// $element is not used, this is just so we know how many times to loop
foreach ($w_naam as $element) {
   // Output the current element in the array
   printf('Results for %s held %s at %s', current($w_naam), current($w_datum), current($w_plaats));

   // Advance each pointer to the next element
   next($w_naam);
   next($w_datum);
   next($w_plaats);
}
pookie62
Forum Commoner
Posts: 92
Joined: Tue Dec 07, 2004 2:44 pm

Post by pookie62 »

Thanks for all your help guys !
Got it working the way I want now.
Post Reply