nullified Posted April 26, 2008 Share Posted April 26, 2008 Im trying to figure out regexpr but after a lot of reading and trial and error i think a real world e.g. maybe usefull for my dumbness i would like to change this to use regexpr, does anyone have an e.g. or can anyone provide assistance. function gethtml($search) { // find out the first occurence of "</tr" and throw the superfluos stuff in front of it away $string = strchr($string, '</tr>'); $string = str_replace('</td>', '|', $string); $string = str_replace('</tr>', '§', $string); $string = chop(strip_tags($string)); $pieces = explode("§", $string); foreach($pieces as $val) { $bits = explode("|", $val); if (strchr($bits[0], $search)) { return $bits; } } } Thanks Quote Link to comment https://forums.phpfreaks.com/topic/102979-regexpr-help/ Share on other sites More sharing options...
phpSensei Posted April 26, 2008 Share Posted April 26, 2008 Maybe the Regex Forum. Whats wrong with this code? Quote Link to comment https://forums.phpfreaks.com/topic/102979-regexpr-help/#findComment-527551 Share on other sites More sharing options...
nullified Posted April 26, 2008 Author Share Posted April 26, 2008 just want to learn regexpr thats all and ive been told its better done with regexpr.....and sorry just figured it should be under php.....someone move it if they like. Quote Link to comment https://forums.phpfreaks.com/topic/102979-regexpr-help/#findComment-527552 Share on other sites More sharing options...
bilis_money Posted April 26, 2008 Share Posted April 26, 2008 @nullified i know you are new here but try to be organized next. this topic should be in regex forum. Quote Link to comment https://forums.phpfreaks.com/topic/102979-regexpr-help/#findComment-527553 Share on other sites More sharing options...
phpSensei Posted April 26, 2008 Share Posted April 26, 2008 just want to learn regexpr thats all and ive been told its better done with regexpr.....and sorry just figured it should be under php.....someone move it if they like. I am pretty sure that this is probably better done your way, and this would take you longer to learn with regex unless you learned more of the basics, and tried to grasp some regex. Quote Link to comment https://forums.phpfreaks.com/topic/102979-regexpr-help/#findComment-527554 Share on other sites More sharing options...
nullified Posted April 26, 2008 Author Share Posted April 26, 2008 @nullified i know you are new here but try to be organized next. this topic should be in regex forum. thanks for the info but i understood the first time. and phpsensi thanks im more than happy to stick with what ive got...thanks again. Quote Link to comment https://forums.phpfreaks.com/topic/102979-regexpr-help/#findComment-527568 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.