Related Content
Creating An Authentication System With PHP and MariaDB
Using frameworks to handle the authentication of your PHP application is perfectly fine to do, and normally encouraged. They abstract away all of the complexity of managing users and sessions that need to work in order to allow your application to function.
Creating Sparklines In PHP
A sparkline is a very small line graph that is intended to convey some simple information, usually in terms of a numeric value over time. They tend to lack axes or other labels and are added to information readouts in order to expand on numbers in order to give them more context.
PHP:CSI - Improving Bad PHP Logging Code
I read The Daily WTF every now and then and one story about bad logging code in PHP stood out to me. The post looked at some PHP code that was created to log a string to a file, but would have progressively slowed down the application every time a log was generated.
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.
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