Remove part of a String. - string value between tags

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
zerandib
Forum Newbie
Posts: 16
Joined: Tue Dec 16, 2008 12:17 am

Remove part of a String. - string value between tags

Post by zerandib »

Hello,

Code: Select all

 
$allvalue = "</table> </div></div></div></div></div></div> [b]<div id="headerhost" valign=center> <iframe src="http://nobaaaahost.com/cgi/bg/headerhost.iframe.cgi" width=100% hspace=0 vspace=0 frameborder="0" scrolling="no" allowautotransparency=true></iframe> </div>[/b] <div id="foothost" valign=center> <iframe src="http://nobaaaahost.com/cgi/bg/foothost.iframe.cgi" width=100% hspace=0 vspace=0 frameborder="0" scrolling="no" allowautotransparency=true></iframe> </div> <script> for (var ems = document.embeds, i = 0, em; em = ems[i]; i++) { em.setAttribute('wmode', 'transparent'); var nx = em.nextSibling, pn = em.parentNode; pn.removeChild(em); pn.insertBefore(em, nx); } </script> <!end nobaaaahost.com bottom ad> </body> </html>"
 

How to remove the this line from the above $allvalue??

<div id="headerhost" valign=center> <iframe src="http://nobaaaahost.com/cgi/bg/headerhost.iframe.cgi" width=100% hspace=0 vspace=0 frameborder="0" scrolling="no" allowautotransparency=true></iframe> </div>


Thanks.
User avatar
Apollo
Forum Regular
Posts: 794
Joined: Wed Apr 30, 2008 2:34 am

Re: Remove part of a String. - string value between tags

Post by Apollo »

Code: Select all

$allvalue = str_replace( 'whatever-you-want-to-remove' , '' , $allvalue );
Post Reply