Re: HTML errors
| From: | David McGlone | Date: | Wed, 12 Jan 2011 11:38:11 +0000 |
| Subject: | Re: HTML errors | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-310692@lists.php.net to get a copy of this message | ||
On Tuesday, January 11, 2011 11:48:33 pm Daniel Brown wrote:
> On Tue, Jan 11, 2011 at 22:35, David McGlone <david@dmcentral.net> wrote:
> > Hi Everyone, I'm having a problem validating some links I have in a
> > foreach. Here is my code:
> > <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
> > "http://www.w3.org/TR/html4/loose.dtd">
> >
> > my PHP code:
> > $categorys = array('home', 'services', 'gallery',
> > 'about_us',
> > 'contact_us', 'testimonials');
> > foreach($categorys as $category){
> > $replace = str_replace("_", " ", $category);
> > echo "<li><a
> > href='index.php?page=$category'>$replace</a></li>";
> > }
> >
> > Validator Error:
> > an attribute value must be a literal unless it contains only name
> > characters
>
> This is because you misspelled $categorys, where it should
> actually be $categories.
Goes to show ya, even Deaf people aren't perfect spellers. Still like your
little joke? ;-)
--
Blessings
David M.