unemployment Posted May 4, 2011 Share Posted May 4, 2011 How can I check this string to see if it has a ~ character using php? $string = 'userlocation~credentials~specialties'; Link to comment https://forums.phpfreaks.com/topic/235501-find-character-in-string/ Share on other sites More sharing options...
salathe Posted May 4, 2011 Share Posted May 4, 2011 Use strpos, if that function returns FALSE then the character is not within the string. $has_tilde = (strpos($string, '~') !== FALSE); Link to comment https://forums.phpfreaks.com/topic/235501-find-character-in-string/#findComment-1210357 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.