Jump to content

how to remove ' in string if it encounter in string


kotharisandeep

Recommended Posts

if an using PHP version 4.4.4 & using this code

 

$first=strpos($tag,"<embed");

$second=strpos($tag,"</embed>");

$url=substr($tag,$first,$second-$first);

$tmp1 = explode("src=", $url);

$tmp2 = explode(" ", $tmp1[1]);

$url1 = str_replace("\"", "", $tmp2[0]);

$url2 = str_replace("'", "", $url1);

$url2 = str_replace("\\", "", $url1);

 

its giving proper result for such code

 

<object width="425" height="350"><param name="movie" value="

name="wmode" value="transparent"></param><embed src="
type="application/x-shockwave-flash" wmode="transparent" width="425" height="350"></embed></object>

 

 

but not giving for this code

 

<style>.hov:hover{background-color:yellow}</style><div id='Title' style='font:bold 13px verdana;width:310px'>Music Video:<a class='hov' style='display:block;width:310px;border:solid 2px black;padding:5px' href="http://videzonn.com/videos/t/the_shins/phantom_limb_whos_next.html" target='_blank'>PHANTOM LIMB: WHO’S NEXT? (by The Shins)<p><embed name='RAOCXplayer' src='http://videzonn.com/videos/t/the_shins/phantom_limb_whos_next_673538.asx' type='application/x-mplayer2' width='300' height='280' autostart='1' ShowControls='1' ShowStatusBar='0' loop='true' EnableContextMenu='0' DisplaySize='0' pluginspage='http://www.microsoft.com/Windows/Downloads/Contents/Products/MediaPlayer/'></embed></a><p style="margin:3px 0px"><a href='http://videzonn.com/' class=ll target=_blank>Music Video Code provided by Video Code Zone</a></p></div>

 

in second case it gives me

'http://videzonn.com/videos/t/the_shins/phantom_limb_whos_next_673538.asx'

but i need

http://videzonn.com/videos/t/the_shins/phantom_limb_whos_next_673538.asx

& working fine with 5.1 but not with 4.4.4

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.