I have an array('one','two','three');
I want to query one time, for one result.
First query using the first array value, the second query with the second array value, the third query using the third array value. Do I have to use some kinda counter to loop through the array values?

query(one); then print result query one;
query(second); then print result query two;
query(third); then print result query three;

How to do that without actually typing the array values in the query function?

Member Avatar for diafol
foreach($array as $item)
{
    echo $item . "<br / >";
}

OR

for($x=0;$x<count($array);$x++)
{
    echo $array[$x] . "<br / >";
}

loads of ways.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.