SE_Danny Posted February 22, 2011 Share Posted February 22, 2011 Hi guys !I have some simple variables $a and $b like that : $a = 'google'$b = 'http://google.com' And what I want to do is define the variable $google like that : $google = 'http://google.com' Is that possible ??Thanks ! Link to comment Share on other sites More sharing options...
Fmdpa Posted February 22, 2011 Share Posted February 22, 2011 You can assign $google like that. The only problem I see is that you are not ending your lines with a semi-colon. Are you asking if you can do this: $b = 'http://www.google.com';$google = $b; If you are asking that, the answer is yes. Link to comment Share on other sites More sharing options...
Ingolme Posted February 22, 2011 Share Posted February 22, 2011 Maybe you mean something like this: $a = 'google';$b = 'http://google.com';$$a = $b;echo $google // Prints 'http://google.com' It's legal in PHP. Link to comment Share on other sites More sharing options...
SE_Danny Posted February 22, 2011 Author Share Posted February 22, 2011 Maybe you mean something like this:$a = 'google';$b = 'http://google.com';$$a = $b;echo $google // Prints 'http://google.com' It's legal in PHP. Yeah that's what I meant Thanks a lot dude !@Fmdpa, of course I know how to assign a variable. I just forgot the ';' But thanks for your reply ! Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.