Jump to content

A big replace problem!


pastet89

Recommended Posts

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?

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.