mike1313 Posted November 30, 2007 Share Posted November 30, 2007 is there anyway to check if the beginning of whatever the user inputs is a space like. Instead of "Hello World" they input " Hello World" I need a way of checking if the space is there first and I'm not talking about trim(); Link to comment https://forums.phpfreaks.com/topic/79547-form-help/ Share on other sites More sharing options...
eon201 Posted November 30, 2007 Share Posted November 30, 2007 $findme = ' Hello World'; //notice the white space $hellofinder = stripos($your_string, $findme); if ($hellofinder === false){ echo "Im not here!"; } else{ echo "Im here!"; } You could then use the str_replace function to change ' Hello World' to 'Hello World' if needed. Hope that helps. Link to comment https://forums.phpfreaks.com/topic/79547-form-help/#findComment-402944 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.