Jump to content

Refreshing a variable in a variable


Masca

Recommended Posts

Hi!  Please help!

 

I am sure there must be a simple way of doing what I want to do, but I can't find it!

 

I would like to hold a url in a variable.  The url contains another variable - e.g.:

 

$url = '/a_page_name/' . $ref . '/';

 

My problem is that $ref is declared (via a MySQL query) after $url is declared.  Is there a way of 'refreshing' $url once $ref has been declared, so that I only need to declare $url once in my header include file which is included at the beginning of all my pages?  I know that I could place it in a separate file which could be included after the MySQL query, but I would rather avoid that if possible.

 

I hope the above makes sense!  TIA.

Link to comment
https://forums.phpfreaks.com/topic/59823-refreshing-a-variable-in-a-variable/
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.