adamriley Posted December 31, 2009 Share Posted December 31, 2009 Hi could someone tell me if this is posible what i need is for example there is a variable named ($username) what i want is to display the users name which would be ($name) there are two users all together how would you do this by doing something like "if $username == adamriley $fullname =adam lee riley else $fullname=nathan" i have tryed the above but Im new to php Im really sorry for not using the code tags but im on a mobile Link to comment https://forums.phpfreaks.com/topic/186824-variablesif-else-statements/ Share on other sites More sharing options...
oni-kun Posted January 1, 2010 Share Posted January 1, 2010 $username = 'adamriley'; if ($username == 'adamriley') { $fullname = 'adam lee riley'; } else { $fullname = 'nathan'; } That should work, your method does not seem so secure though, what are you trying to do? Link to comment https://forums.phpfreaks.com/topic/186824-variablesif-else-statements/#findComment-986619 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.