Reply to Re: Tool to validate HTML code with PHP tags?

Your name:

Reply:


Posted by webrod on 04/30/07 07:41

Geoff,

you say: " can't see how you could possibly check the validity of the
code
without parsing the php".
That's the point. You *do not need* to parse the php to validate the
XHTML if you code properly.

You're examples are very good.
Let's have a look:

> <?php if($something_is_true){ ?>
> <div style='border:1px solid
> red;padding:20px;margin:20px;text-align:center'>
> <?php } ?>

I you read my other messages, a tool like tidy could say: "I don't
care about php code, so I update the text like this":
//REMOVED PHP TAGS
<div style='border:1px solid
red;padding:20px;margin:20px;text-align:center'>
//removed PHP TAGS

so I parse only:
<div style='border:1px solid
red;padding:20px;margin:20px;text-align:center'>

So where is the need to validate PHP code??
Anyway PHP code validation is done by a real development tool in the
very first step (like ZEND).

Again here:
<?php if($something_else_is_true){ ?>
<div style='border:1px solid
blue;padding:20px;margin:20px;text-align:center'>
some content
</div>
<?php } ?>

It could be updated like this by a tool like TIDY:
//REMOVED PHP TAGS
<div style='border:1px solid
blue;padding:20px;margin:20px;text-align:center'>
some content
</div>
//REMOVED PHP TAGS

so:
<div style='border:1px solid
blue;padding:20px;margin:20px;text-align:center'>
some content
</div>

etc etc

> OK, you may /never/ code like this. But that's not the point.

yes, you're right, this is out of scope, My apologies.


Rod

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация