Hi All,
I have a cfm file which is called from a third party website.
In this file there is a menu bar which i need to strip, the menu bar is in between a tag as such:
<EDITION>
<table borde="0">
<tr>
<td>my menu bar</td>
</tr>
</table>
</EDITION>
so i want to take all the code between the tag <EDITION>
Any ideas how i can strip the menu and display the remaining code from the third party website?
strip html from third party site
Moderator: General Moderators
How can i store the entire context of a html file in a variable?
for example if i have quotes("") and say:
<?php
$myvar = "
<script language="javascript">
location.href = 'point.htm';
</script>
<table border="0">
<tr>
<td></td>
</tr>
</table>
";
?>
I get an error, how can i store the entire context in a variable?
for example if i have quotes("") and say:
<?php
$myvar = "
<script language="javascript">
location.href = 'point.htm';
</script>
<table border="0">
<tr>
<td></td>
</tr>
</table>
";
?>
I get an error, how can i store the entire context in a variable?
- feyd
- Neighborhood Spidermoddy
- Posts: 31559
- Joined: Mon Mar 29, 2004 3:24 pm
- Location: Bothell, Washington, USA
start using
Code: Select all
tags.
All the information you need to build your own pattern can be found from the Useful Posts thread. There's a link to it in my signature.I've used this code below to strip the text but when i do the substr_replace function with the star and end positions, it strips the actual text and not the html tags....any ideas how i can make sure all the html in the string is stripped and tags in the start and end positions?
Code: Select all
$spos = strpos($rep2,"<!EDITION>");
$epos = strpos($rep2,"<!/EDITION>");
$rep3 = substr_replace($rep2, "", $spos, $epos);- Chris Corbyn
- Breakbeat Nuttzer
- Posts: 13098
- Joined: Wed Mar 24, 2004 7:57 am
- Location: Melbourne, Australia
*cough* regexps* *cough*
preg_replace as feyd already said.
preg_replace as feyd already said.
Code: Select all
$rep3 = preg_replace('/<\!EDITION>(.|\s)*<\!\/EDITION>/i', '', $rep2);