|
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]
|