arunner Posted December 9, 2009 Share Posted December 9, 2009 hey, I'm having big problems with a scrap of code I made. I traced the bug down, and for some reason..it's here; and I can't figure it out. I think it's the $ in the preg_replace function. Here's my code: //set patterns $pattern = array( '/\$PARENT_PATH\$/', '/\$PATH\$/' ); //set replacements $replacement = array( $parent_path, $path ); foreach($a['html'] as $key=>$value){ echo $key . "BLAH"; //make replacements $value = preg_replace($pattern, $replacement, $value); //add new lines on the end of every html section $value = $value . $n; //set value in user html array $a['html'][$key] = $value; } any help would be greatly appreciated. :] Quote Link to comment https://forums.phpfreaks.com/topic/184490-in-preg_replace/ Share on other sites More sharing options...
trq Posted December 9, 2009 Share Posted December 9, 2009 You forgot to actually describe your problem. Quote Link to comment https://forums.phpfreaks.com/topic/184490-in-preg_replace/#findComment-973894 Share on other sites More sharing options...
arunner Posted December 9, 2009 Author Share Posted December 9, 2009 oh, dude, thanks thorpe! when I go to load the page, it loads and loads and...yeah...obviously a big loop or constant flow of data of some sort. i always have to restart the server afterwards Quote Link to comment https://forums.phpfreaks.com/topic/184490-in-preg_replace/#findComment-973895 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.