redarrow Posted March 7, 2013 Share Posted March 7, 2013 $string = ereg_replace(' +', ' ', trim($string)); can someone preg relace in stead of eregi please ... Quote Link to comment https://forums.phpfreaks.com/topic/275365-preg_replace-help-cheers/ Share on other sites More sharing options...
trq Posted March 7, 2013 Share Posted March 7, 2013 No. Quote Link to comment https://forums.phpfreaks.com/topic/275365-preg_replace-help-cheers/#findComment-1417176 Share on other sites More sharing options...
redarrow Posted March 7, 2013 Author Share Posted March 7, 2013 why that then where dan Quote Link to comment https://forums.phpfreaks.com/topic/275365-preg_replace-help-cheers/#findComment-1417178 Share on other sites More sharing options...
AyKay47 Posted March 7, 2013 Share Posted March 7, 2013 IMO, regular expressions should only be used when searching for a complex pattern within a string as they use more resources. For logic that requires searching for a simple static string within a string, use a string function such as strpos. Quote Link to comment https://forums.phpfreaks.com/topic/275365-preg_replace-help-cheers/#findComment-1417179 Share on other sites More sharing options...
redarrow Posted March 7, 2013 Author Share Posted March 7, 2013 (edited) it in a 9000 scrape cue to slow needs preg_replace. Â Â function sanitize_string($string) { $string = ereg_replace(' +', ' ', trim($string)); return preg_replace("/[<>]/", '_', $string); } function takes for ever scraping Edited March 7, 2013 by redarrow Quote Link to comment https://forums.phpfreaks.com/topic/275365-preg_replace-help-cheers/#findComment-1417182 Share on other sites More sharing options...
trq Posted March 7, 2013 Share Posted March 7, 2013 You need to try and put your sentences together so that they can be comprehended properly by those reading them. Quote Link to comment https://forums.phpfreaks.com/topic/275365-preg_replace-help-cheers/#findComment-1417186 Share on other sites More sharing options...
AyKay47 Posted March 7, 2013 Share Posted March 7, 2013 (edited) str_replace is your friend Edited March 7, 2013 by AyKay47 Quote Link to comment https://forums.phpfreaks.com/topic/275365-preg_replace-help-cheers/#findComment-1417189 Share on other sites More sharing options...
redarrow Posted March 7, 2013 Author Share Posted March 7, 2013 (edited) i am scrapping a whole seach engine and using 900 public proxy's thru php long time app i am working on also decaptcher app but the problam the whole 18 pages work except eregi pulls a error as it scrapes it i pump more bandwith to the code yes scrapes lovly but that no good for a avarage person. Edited March 7, 2013 by redarrow Quote Link to comment https://forums.phpfreaks.com/topic/275365-preg_replace-help-cheers/#findComment-1417190 Share on other sites More sharing options...
redarrow Posted March 7, 2013 Author Share Posted March 7, 2013 i am a blind user so keyboard problams it all mouth typing sorry Quote Link to comment https://forums.phpfreaks.com/topic/275365-preg_replace-help-cheers/#findComment-1417192 Share on other sites More sharing options...
redarrow Posted March 7, 2013 Author Share Posted March 7, 2013 (edited) ill use that idea sick are you the owner of sick seo softwere?? Edited March 7, 2013 by redarrow Quote Link to comment https://forums.phpfreaks.com/topic/275365-preg_replace-help-cheers/#findComment-1417195 Share on other sites More sharing options...
AyKay47 Posted March 7, 2013 Share Posted March 7, 2013 (edited) No, I am not. Using str_replace() instead of preg_replace() in this case will save resources as well as execution time. Edited March 7, 2013 by AyKay47 Quote Link to comment https://forums.phpfreaks.com/topic/275365-preg_replace-help-cheers/#findComment-1417200 Share on other sites More sharing options...
Solution redarrow Posted March 7, 2013 Author Solution Share Posted March 7, 2013 ill give that a go cheers mate... Quote Link to comment https://forums.phpfreaks.com/topic/275365-preg_replace-help-cheers/#findComment-1417201 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.