Reply to Re: cleaning up classes and ids in large site

Your name:

Reply:


Posted by Toby A Inkster on 02/16/07 08:29

shimmyshack wrote:

> Using XHR to send back the element id's of the css styles array which
> you save crossing them off your list, (and out of the styles js array/
> object)

Quite a nifty idea, and in certain cases more reliable than a regexp-based
search. I'm thinking specifically of something like:

<?php
function startTag ($e, $attr=array())
{
$r = '<'.strtolower($e);
foreach ($attr as $k=>$v)
$r .= ' '.strtolower($k).'="'.htmlentities($v).'"';
$r .= '>';
return $r;
}
function endTag ($e, $attr=array())
{
return '</'.strtolower($e).'>';
}

print startTag('A',
array(
'href'=>'http://www.google.co.uk/',
'class'=>'external_link',
)
)
.'Google'.
endTag('A',
array(
'href'=>'http://www.google.co.uk/',
'class'=>'external_link',
)
);

?>

--
Toby A Inkster BSc (Hons) ARCS
Contact Me ~ http://tobyinkster.co.uk/contact
Geek of ~ HTML/SQL/Perl/PHP/Python*/Apache/Linux

* = I'm getting there!

[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

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