suave4u Posted April 7, 2010 Share Posted April 7, 2010 I have a site where a user can submit BBCode from a gallery host. The problem is if the BBCode is using upper case, my site only recognizes the first thumbnail and then ignores the rest. If the user converts everything to lower case, it all works perfect. I have found the 'strtolower' function but I am not sure how to use it in the array. I am just wanting to know how to change this to where it takes all incoming BBCode and converts it to lower case first and then submits it. Thank you for the help! [attachment deleted by admin] Link to comment https://forums.phpfreaks.com/topic/197873-lower-case-converting/ Share on other sites More sharing options...
runnerjp Posted April 7, 2010 Share Posted April 7, 2010 $message = 'MAKE ME LOWERCASE'; $newmessage = strtolower($message); Link to comment https://forums.phpfreaks.com/topic/197873-lower-case-converting/#findComment-1038440 Share on other sites More sharing options...
jcbones Posted April 7, 2010 Share Posted April 7, 2010 I suppose you are using preg_replace() to change your bbcode to HTML? If so, add the i modifier for case insensitive matching. EX. $str = 'FOO'; $pattern = '/foo/i'; if(preg_match($pattern,$str)) //true Link to comment https://forums.phpfreaks.com/topic/197873-lower-case-converting/#findComment-1038443 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.