redarrow Posted March 7, 2013 Share Posted March 7, 2013 $string = ereg_replace(' +', ' ', trim($string)); can someone preg relace in stead of eregi please ... 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. 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 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. 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 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 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. 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 str_replace is your friend 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 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. 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 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 ill use that idea sick are you the owner of sick seo softwere?? 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 No, I am not. Using str_replace() instead of preg_replace() in this case will save resources as well as execution time. Link to comment https://forums.phpfreaks.com/topic/275365-preg_replace-help-cheers/#findComment-1417200 Share on other sites More sharing options...
redarrow Posted March 7, 2013 Author Share Posted March 7, 2013 ill give that a go cheers mate... Link to comment https://forums.phpfreaks.com/topic/275365-preg_replace-help-cheers/#findComment-1417201 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.