Neptunus Maris Posted October 26, 2007 Share Posted October 26, 2007 Brothas and Sistas Do you actually have to use the third parameter in preg_match_all??? preg_match_all(string $pattern, string $subject, array &$matches [, int $flags [, int $offset]]) This is before I test, I rarely use the pregs... So if you know please let me know.. Thanks, Your Favorite Sea God Neptune...lol, kidding Quote Link to comment https://forums.phpfreaks.com/topic/74824-do-you-actually-have-to/ Share on other sites More sharing options...
per1os Posted October 26, 2007 Share Posted October 26, 2007 Yes you do. Since the parameter is not in the [ ] it means it is a required parameter. Quote Link to comment https://forums.phpfreaks.com/topic/74824-do-you-actually-have-to/#findComment-378339 Share on other sites More sharing options...
Neptunus Maris Posted October 26, 2007 Author Share Posted October 26, 2007 Yes you do. Since the parameter is not in the [ ] it means it is a required parameter. BOOOOO.... Quote Link to comment https://forums.phpfreaks.com/topic/74824-do-you-actually-have-to/#findComment-378342 Share on other sites More sharing options...
Neptunus Maris Posted October 26, 2007 Author Share Posted October 26, 2007 Yes you do. Since the parameter is not in the [ ] it means it is a required parameter. ok...but what if i just want to find each pattern find but dont need to print it? what would i do with the 3rd parameter then? like this: <?php //-------- // $pattern = "/^http://.*\.+/"; $cleaned_str = eregi_replace($pattern, "[don't know yet]", $cleaned_str); //test to be contained inside the eregi_replace() function eregi_replace($pattern, "<a href = \"".preg_match_all($pattern, $cleaned_str, $matches)."\">".preg_match_all($pattern, $cleaned_str, $matches)."</a>", $cleaned_str); //-------- ?> Quote Link to comment https://forums.phpfreaks.com/topic/74824-do-you-actually-have-to/#findComment-378379 Share on other sites More sharing options...
sKunKbad Posted October 26, 2007 Share Posted October 26, 2007 I dont see a point of using preg_match_all if you aren't going to generate an array from back references inside your regex. Quote Link to comment https://forums.phpfreaks.com/topic/74824-do-you-actually-have-to/#findComment-378385 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.