rhyspaterson Posted July 11, 2008 Share Posted July 11, 2008 Hey guys, Have this at the moment: if (preg_match("/a/i", $variable)) { $result++; } If the variable has the letter a in it (not case sensitive), add one to the result. Works fine, however i only want to see if only the second character in the string has the letter a, not go through the whole string. Any suggestions? Cheers Link to comment https://forums.phpfreaks.com/topic/114196-solved-search-string-for-character-at-certain-position/ Share on other sites More sharing options...
rhyspaterson Posted July 11, 2008 Author Share Posted July 11, 2008 edit: whoops! Wrong section - my bad, please delete Link to comment https://forums.phpfreaks.com/topic/114196-solved-search-string-for-character-at-certain-position/#findComment-587160 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.