what's the total number of "l"s in:
firefox is jolly good isn't it? personas are jolly good too and i've done this one for work:
now to try some op. art ones... ;-)
dominic myers writes about all sorts of stuff to do with php, javascript and life in general.
firefox is jolly good isn't it? personas are jolly good too and i've done this one for work:
now to try some op. art ones... ;-)
melt marg, sugar and syrup together. put in oats and oven at 150 degree c for 20-30 minutes.
gill myers recipe for same.
passed.
i've been working on something for ages which involved creating some xml formatted data using php. phps implementation of xml has come on leaps and bounds, it seems, and i must admit to being pretty happy with the results using phps dom implementation. so i uploaded the xml to its target api and nothing happened. and nothing kept happening, over and over again...
after a fair bit of head-scratching and trying any number of things. i tried to see if the xml was broken somehow and managed to run foul of trying to print an xml object before converting it to a string with savexml()... oops! then i thought about the xml prolog and how the examples of using the api i'd seen hadn't had the whole <?xml version="1.0"?> at the beginning of the xml. now how was a going to get rid of it?
at first i just echoed the xml to a browser and copied the resultant xml into boxer (and sure, who wouldn't use boxer with it's lovely format xml tool?). then i removed the prolog and copied it into a string variable using the "here document" syntax and tried to upload that and all worked well. a bit clunky but it worked!.
how to remove the prolog programmatically though?
i got to thinking about my initial fascination with xml and the stuff i read in 2004 or so and remembered xsl. php can use xsl so i did a bit of research and came up with this xsl file:
<xsl:stylesheet <xsl:output <xsl:template <xsl:copy> <xsl:apply-templates </xsl:copy> </xsl:template> </xsl:stylesheet>
then it was a simple matter to put the following in the script:
// load xml file $xsl = new domdocument; $xsl->load('removeprolog.xsl', libxml_nocdata); // configure the transformer $proc = new xsltprocessor; // and attach the xsl rules $proc->importstylesheet($xsl); // replace the xml with the transformed xml $xml = $proc->transformtoxml($xml);
hey presto, all done and my hair can get back to growing ;-)
user
In that passage, there are 99 occurrences of the letter "l."
assistant