IwnfuM Posted August 23, 2010 Share Posted August 23, 2010 I wonder if is out there function in php that is doin this . function like strpos that is does not notice from CAPITAL words to small words. function like strpos that does finds all matchs and not only 1. function like strpos that is search inside connected words like "strposfunction" so if i search "function" it will find it. thanks , Mor. Quote Link to comment https://forums.phpfreaks.com/topic/211513-built-in-functions/ Share on other sites More sharing options...
JonnoTheDev Posted August 23, 2010 Share Posted August 23, 2010 Yes there are. They use regular expressions as parameters. Regular expressions are difficult at first, but they are essential when you are working with text strings. http://uk.php.net/manual/en/function.preg-match.php http://uk.php.net/manual/en/function.preg-match-all.php Here is a good starting point. http://www.webcheatsheet.com/php/regular_expressions.php Quote Link to comment https://forums.phpfreaks.com/topic/211513-built-in-functions/#findComment-1102747 Share on other sites More sharing options...
AbraCadaver Posted August 23, 2010 Share Posted August 23, 2010 I wonder if is out there function in php that is doin this . function like strpos that is does not notice from CAPITAL words to small words. stripos() Quote Link to comment https://forums.phpfreaks.com/topic/211513-built-in-functions/#findComment-1102771 Share on other sites More sharing options...
IwnfuM Posted August 23, 2010 Author Share Posted August 23, 2010 i was always refuse to learn regex but i think this is time to learn. thanks , Mor. Quote Link to comment https://forums.phpfreaks.com/topic/211513-built-in-functions/#findComment-1102776 Share on other sites More sharing options...
AbraCadaver Posted August 23, 2010 Share Posted August 23, 2010 i was always refuse to learn regex but i think this is time to learn. thanks , Mor. Regex is good to know and I would say to learn it, however, if you could be more specific about your last two questions, it may be simpler. For the second question, 'find the number of matches' or the 'starting postion of all matches'? For the last question, that's exactly what strpos() does. What do you mean by find it? strpos("strposfunction", "function"); returns 6, so it found it. Quote Link to comment https://forums.phpfreaks.com/topic/211513-built-in-functions/#findComment-1102785 Share on other sites More sharing options...
IwnfuM Posted August 23, 2010 Author Share Posted August 23, 2010 I meant that strpos function find 1 match and than give back the result. I looking for function that actually find all matches in the text and not the first one. about the last function i was talking about i was confused so forget about it. and thanks for interesting , Mor. Quote Link to comment https://forums.phpfreaks.com/topic/211513-built-in-functions/#findComment-1102905 Share on other sites More sharing options...
JonnoTheDev Posted August 24, 2010 Share Posted August 24, 2010 I looking for function that actually find all matches in the text and not the first one. preg_match_all() Quote Link to comment https://forums.phpfreaks.com/topic/211513-built-in-functions/#findComment-1103022 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.