Related Content
Validating XML Files With XML Schema Definitions In PHP
XML is a useful format for configuration, data storage, and transmitting data from one system to another. As a human readable format that can be easily read by machines it quickly gained favor in lots of different systems as a mechanism for data storage.
Creating A Character Bitmap In PHP
I was watching a video from NDC by Dylan Beattie the other day on The Story of Typography and a particular section stood out to me.
Approximating Pi Using A Circle And A Square
Pi day was a few weeks ago, but I came across this simple approximation of pi recently and decided to put together an example in PHP since it seemed pretty simple.
This approximation of pi centers around a real world example, but we can simulate this using some code.
Drawing A Parabolic Curve With Straight Lines In PHP
A parabolic curve is a type of curve where every point is an equal distance from a focal point. There a number of different way to generate this sort of curve using math, but one of the simplest is to use straight lines to create the illusion of the curve.
Recreating Spotify Wrapped In PHP
I quite like the end of the year report from Spotify that they call "Wrapped". This is a little application in which they tell you what your favorite artist was and what sort of genres you listened to the most during the year.
Should A Constructor Throw An Exception?
Let's say you had a class that you wanted to use, but there was some sort of error in creating the object. This might be that the wrong parameters were passed, or the third party service (eg. a database) wasn't available at the time of creation.
Comments
Submitted by Chris Schmidt on Tue, 02/03/2009 - 16:48
PermalinkSubmitted by giHlZp8M8D on Tue, 02/03/2009 - 17:01
PermalinkSubmitted by Chris Schmidt on Tue, 02/03/2009 - 17:31
PermalinkSubmitted by giHlZp8M8D on Tue, 02/03/2009 - 19:13
PermalinkActually not quite - I had to add a greater than before the shortenurl and a less than behind - cause the regexp did take them out from the a href and end a tags ... I just have one issue with the above statement - I found that if I have something like http://this.is.a.very.long.url the script will shorten the URL which results in a loss of the original information since there is no link on it that stays untouched. So would you be able to modify the statement that it only matches something like:
To make sure I only catch links with the URL as the text and not just URLs that don't have a link associated with them? Thanks so much Chris
Submitted by Chris Schmidt on Wed, 02/04/2009 - 09:24
PermalinkSubmitted by Chris Schmidt on Wed, 02/04/2009 - 09:28
PermalinkSubmitted by giHlZp8M8D on Wed, 02/04/2009 - 09:40
PermalinkSubmitted by Chris Schmidt on Wed, 02/04/2009 - 10:19
PermalinkSubmitted by giHlZp8M8D on Wed, 02/04/2009 - 10:30
PermalinkSubmitted by Chris Schmidt on Wed, 02/04/2009 - 12:08
PermalinkSubmitted by sanjeev on Tue, 06/04/2013 - 11:41
PermalinkAdd new comment