Jump to content

[SOLVED] For statment


the_oliver

Recommended Posts

You are best of setting up an array. You do it like so:

$c[] = 'some value';
$c[] = 'some other value';
$c[] = 'what ever else']

That will create an array. remeber everytime you do $c[]= you create new item for the array.

When you've created the array you can run through the array using a foreach loop like so:
[code=php:0]foreach($c as $value)
{
    // call your function
    urFunc($value);
}[/code]


Or you can use [url=http://www.php.net/manual/en/function.array-map.php]array_map[/url] which does the same thing as the foreach loop above
Link to comment
https://forums.phpfreaks.com/topic/33097-solved-for-statment/#findComment-154264
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.