pastet89 Posted January 17, 2009 Share Posted January 17, 2009 Hello all! I am wondering what to do with an issue I can't solve from hours... The promlem is: I have this code: $html2 = <<<RR <form method='post' action='request.php'> <input type='hidden' name='broj' value='359878791261'> <table bgcolor='#80ff80' border='0' cellpadding='0' cellspacing='0' width='331'><tbody><tr bgcolor='#ffffff'><td colspan='4' height='4'></td></tr><tr><td colspan='4' height='1'></td></tr> <tr bgcolor='#82fc74'><td class='title' colspan='4' height='18'> <b>Internatinal</b> - Club Friendlies</td></tr><tr bgcolor='#82fc74'><td class='match-light' width='45' height='18'> 12:41</td><td class='match-light' colspan='3' align='right' width='286'>Януари 16 </td></tr><tr><td colspan='4' height='1'></td></tr><tr bgcolor='#cfcfcf'><td width='45' height='18'> <img src='http://cdn.livescore.com/img/flash.gif' border='0' width='8' height='8'> 90'</td><td align='right' width='118'></td><td align='right' width='118'>Leverkuzen</td><td align='center' width='50'>? - ?</td><td width='118'>Frankfurt</td></tr><tr><td colspan='4' height='1'></td></tr><tr bgcolor='#cccccc'><td width='45' height='18'> FT</td><td align='right' width='118'>Hanover</td><td align='center' width='50'>? - ?</td><td width='118'>Augsburg</td></tr><tr><td colspan='4' height='1'></td></tr><tr bgcolor='#cfcfcf'><td width='45' height='18'> 18:00</td><td align='right' width='118'>Yung Boys</td><td align='center' width='50'>? - ?</td><td width='118'>Vinterture</td></tr><tr><td colspan='4' height='1'></td></tr></table> RR; $from = "</td><td align='right' width='118'>"; $to = "<input type='radio' value='' name='utakmica'></td><td align='right' width='118'>"; $html2 = str_replace($from, $to, $html2); echo $html2; As you can see here: http://livescore-bg.net/lolo/proba2.php everything is ok with the $from string, when before it there is "FT" or "18:00", but in the first of the three replacements, where before "</td><td align='right' width='118'>" there is ' , the replacement is full with errors. DO you have any idea why is that and what function am I supposed to use, to succsesfully replace the three replacement strings without errors, like the last two? Quote Link to comment https://forums.phpfreaks.com/topic/141239-a-big-replace-problem/ Share on other sites More sharing options...
DeanWhitehouse Posted January 17, 2009 Share Posted January 17, 2009 First off most of what you wrote makes no sense, second please put php tags in as it provides syntax highlighting making it easier to read, third why are you using str_replace if you are manually writing it ? Quote Link to comment https://forums.phpfreaks.com/topic/141239-a-big-replace-problem/#findComment-739242 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.