Posted by Nitrous on 10/10/88 11:33
Thanks Peter
In this case that will probably work... I'll try.
But my question really is about trying to
"concatenate" $general_image to $i to achieve the variable name
$general_image1
Any thoughts on this.
Cheers Nitrous
"Peter van Schie" <vanschie.peter@gmail.com> wrote in message
news:4390e734$0$54181$dbd4f001@news.wanadoo.nl...
> Nitrous wrote:
>> Hi I can't find info on how to achieve the following:
>>
>> I want to increment through the variable names I've already set.
>> Specifically $general_image1, $general_image2 & $general_image3
>>
>> I need something like this code (that works !!)
>>
>> for($i=1; $i<4; $i++)
>> {
>> if($general_image[$i] != " ")
>> {
>> blah blah...
>> }
>> }
>
> I'm not sure as to what you're trying to accomplish exactly, but my guess
> is that you want to iterate through the general_image array?
> In that case you could use foreach, like:
>
> <?php
> foreach($general_image as $cur_image)
> {
> if ($cur_image != " ")
> {
> // do your magic...
> }
> }
> ?>
>
> HTH.
> Peter.
> --
> http://www.phpforums.nl
Navigation:
[Reply to this message]
|