Re: Encoding for W3C Validation

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Aug 3, 2010, at 2:47 PM, Sebastian Ewert 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" ...'


Thanks Sebastian.

In the above, what is the function of the period in front of $myitem?

--Rick


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux