Try This...

for($i=1; $i<=35; $i++)
{
    $sVarName = "link$i";

    if(empty($$sVarName))
    {
       //Do Something
    }
    else
    {
       //Do Something Else using $$sVarName...
    }
}


-Jason Garber
deltacron.com




At 01:42 PM 9/25/2001 -0400, Jordan Elver wrote:
>Hi,
>I'm feeling a bit stupid. I have a,load of variables coming from a MySQL
>connection using list(). The variables are link1 to link 35 inclusive.
>
>How can I access each of these variables, check if they are empty, then add
>them to an array. I don't know how to access then inside a for loop. Can I
>use $link and append the number on the end somehow?
>
>Any help please,
>
>Jord
>
>--
>PHP General Mailing List (http://www.php.net/)
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]
>To contact the list administrators, e-mail: [EMAIL PROTECTED]


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to