thecard Posted May 11, 2008 Share Posted May 11, 2008 I have a simple if statement comparing a form input ($_POST) and a set variable. Basically this: if ($_POST['form'] == $var) ... I want to make it something like this: if ($_POST['form'] == I .$var) SO if the user types "I" then the variable it is true, but how do I make the space between I and .$var acceptable? I'm basically asking what the special character is for space when joining a string and variable I think because php doesn't recognise the space I put between the two. Thanks. Link to comment https://forums.phpfreaks.com/topic/105129-solved-newbie-question-sorry-i-really-should-know-this/ Share on other sites More sharing options...
LooieENG Posted May 11, 2008 Share Posted May 11, 2008 "stuff $var Stuff" or 'stuff ' . $var . ' Stuff' So... if ($_POST['form'] == "I $var") or if ($_POST['form'] == 'I ' . $var) Is that what you mean? Link to comment https://forums.phpfreaks.com/topic/105129-solved-newbie-question-sorry-i-really-should-know-this/#findComment-538239 Share on other sites More sharing options...
thecard Posted May 11, 2008 Author Share Posted May 11, 2008 Thanks. I didn't think it was THAT simple. (SOLVED) Link to comment https://forums.phpfreaks.com/topic/105129-solved-newbie-question-sorry-i-really-should-know-this/#findComment-538258 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.