Related Content
Generating Histogram Colour Analysis Graphs From Images In PHP
If you've ever looked at the settings in a digital camera, or have experience with image processing programs like GIMP, then you may have seen a colour histogram. This is a simple graph that shows the amount of different shades of colour are present in the image.
PHP:CSI - To Switch, Or Not To Switch?
I was writing unit tests for a API mapping function recently and came across this interesting issue. The code I was writing tests for was in a legacy codebase that I was making changes to, and it made sense to have some unit tests in there before I started work to ensure everything worked before and after.
Drupal 9: Generating Header Images For Pages Of Content Using PHP
Embedding image within pages of content helps both within the design of the page and when shared on social media. If you set up meta tags to point at a particular image then that image will appear when the page is shared on social media. This makes your page stand out more.
Using PSR-4 With Composer
The PHP Standards Recommendations (called PSR) are a set of standards that aim to make certain aspects of working with PHP easier.
Generating A PDF From A Web Page Using PHP And Chrome
Generating a PDF document from a web page through PHP can be problematic. It's often something that seems quite simple, but actually generating the document can be difficult and time consuming.
PHP:CSI - Date Is Less Than One Month Ago
Working with logic surrounding dates can sometimes be difficult and it's fairly common to come across really subtle date and time based bugs.
I was recently shown a bug in a PHP application that looks like it should be working at face value, but doesn't actually produce the correct result.
Comments
Submitted by Indy on Sun, 02/17/2008 - 12:25
PermalinkI know about XML parsing in PHP. Here is how to do the same sort of thing with the XML engine in PHP.
Just expand the startElement function to include whatever you are looking for.
Just out of interest I did some timing of the two different ways of getting at the data; XML or regular expressions. To ensure that nothing odd was going on I only downloaded the data once at the top of the script and then ran the two ways 10,000 times each on the same data. I didn't print anything off just in case that effected things, but I left in all of the if statements. Here is the average times:
Average regular expression time 0.00013191080093384 Average XML parse time 0.00088728330135345
There isn't much in it but it looks like regular expressions are a bit quicker than XML parsing. Unless I have done something wrong with along the way?
Submitted by philipnorton42 on Wed, 02/20/2008 - 15:04
PermalinkSubmitted by Marty Martin on Tue, 03/25/2008 - 14:52
PermalinkSubmitted by philipnorton42 on Tue, 03/25/2008 - 20:01
PermalinkSubmitted by Mohamed Mahmoud on Wed, 03/03/2010 - 17:13
PermalinkSubmitted by philipnorton42 on Thu, 03/04/2010 - 09:00
PermalinkSubmitted by rhoula on Wed, 08/15/2012 - 18:00
PermalinkJust create a script like I have above (either via regex or xml parsing) but save the information into a database table or something.
All you need to do then is create a cron job that will run the script once a day. Something like the following would do this:
* * 23 * * php /path/to/script.php
Submitted by philipnorton42 on Thu, 08/16/2012 - 09:08
PermalinkAdd new comment