redarrow Posted March 8, 2008 Share Posted March 8, 2008 The name wont change within the img tag to john stays as abcd <?php if($_POST['submit']){ $text=$_POST['text']; $img=$_POST['img']; $a=explode(' ',$text); foreach($a as $img){ if(eregi_replace('\[img=*\]','john',$img)){ echo $img; } } } ?> <center> <form method="POST" action=" "> PLEASE ENTER TEXT AND USE [img= ] TO ENTER IMAGE'S <p></p> <textarea name="text" cols="40%" rows="20%"></textarea> <p></p> <input type="submit" name="submit" value="submit"> </form> </center> Quote Link to comment https://forums.phpfreaks.com/topic/95059-code-broke-please-help/ Share on other sites More sharing options...
wildteen88 Posted March 8, 2008 Share Posted March 8, 2008 You need to escape the ] brackets too. (\]) Quote Link to comment https://forums.phpfreaks.com/topic/95059-code-broke-please-help/#findComment-486918 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.