Re: Encoding for W3C Validation
| From: | Shreyas Agasthya | Date: | Tue, 03 Aug 2010 18:51:02 +0000 |
| Subject: | Re: Encoding for W3C Validation | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-307300@lists.php.net to get a copy of this message | ||
Rick,
Probably Sebastian's fix might work but *htmlspecialchars* can help you,
too.
Regards,
Shreyas
On Wed, Aug 4, 2010 at 12:17 AM, Sebastian Ewert <seb2015@yahoo.de> wrote:
> 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" ...'
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
--
Regards,
Shreyas Agasthya