Re: [PHP] Encoding for W3C Validation

[email protected] (Sebastian Ewert)
Newsgroups php.general
Message-ID <[email protected]>
Rick Dwyer wrote:
> Hello List.
> 
> In the Alt section of the IMG tag below, the variable $myitem has a value of "Who's There".
> 
> echo "<div class='myclass'><a href='#' class='color_thumb'> <img src='/itemimages/$mypic' alt='$myitem' width='60' ....
> 
> When running through W3C validator, the line errors out because of the " ' " in "Who's".
> I tried:
> $myitem=(htmlentities($myitem));
> 
> But this has no affect on "Who's".
> 
> What's the best way to code this portion so the apostrophe is handled correctly?
> 
> 
> TIA,
> 
> --Rick
> 
> 
> 
> 
Use it


echo '<div class="myclass"><a href="#" class="color_thumb"> <img
src="/itemimages/'.$mypic.'" alt="'.$myitem.'" width="60" ...'
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.