declaring variable inside a variable
Posted: Fri Jul 20, 2007 4:40 am
Hi,
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 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.