Jump to content

Variable in a Variable?


ChrisMartino

Recommended Posts

Do you mean

$var = $upload_path = "/Main/Uploads/$username";
    echo $upload_path; // Returns /Main/Uploads/Foobar
    echo $var; // Returns /Main/Uploads/Foobar

 

You can assign two variables at once, but your original 'variable within a variable' question doesn't make so much sense.

 

That $var = .. I'm not sure why you're doing, you can just do:

$upload_path = "/Main/Uploads/$username";

 

And it will fill the $username variable accordingly.

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.