Forum Moderators: coopster
there is a img tag
<img vspace="4" hspace="4" border="1" align=right alt="" src="http://www.example.com/image.gif"/>
after running
I am left with
<img vspace=4 hspace=4 border=1 align=right alt= src=http://www.example.com/image.gif />
how can I leave the closing "" around the tags, ie alt=""?
Here is my strip tag cmd
while($input!= strip_tags($input, '<b><i><em><strong><img><br><blockquote><object><param><embed><p><quote>'))
{
$input = strip_tags($input, '<b><i><em><strong><img><br><blockquote><object><param><embed><p><quote>');
}
not working, thanks!
B
[edited by: eelixduppy at 8:47 pm (utc) on Sep. 20, 2007]
[edit reason] please use example.com [/edit]
<pre>
<?php
$input = '<img vspace="4" hspace="4" border="1" align=right alt="" src="http://www.example.com/image.gif"/>' . "\n";
print htmlentities($input);
while($input!= strip_tags($input, '<b><i><em><strong><img><br><blockquote><object><param><embed><p><quote>')) {
$input = strip_tags($input, '<b><i><em><strong><img><br><blockquote><object><param><embed><p><quote>');
}
print htmlentities($input);
exit;
?>
</pre>
<img vspace="4" hspace="4" border="1" align=right alt="" src="http://www.example.com/image.gif"/>
<img vspace="4" hspace="4" border="1" align=right alt="" src="http://www.example.com/image.gif"/>
If I "View Source":
<pre>
<img vspace="4" hspace="4" border="1" align=right alt="" src="http://www.example.com/image.gif"/>
<img vspace="4" hspace="4" border="1" align=right alt="" src="http://www.example.com/image.gif"/>
what version of PHP?
As I stated earlier, same version:
I just tested on 4.4.7 without any issue.
You are using the same strip tags params?
I cut and pasted your code!
You must have something else wrong. As I stated before, did you try just the code in the test case that I posted. Try that, and that alone to see if it works. If it does, then you have something else causing your issue.