<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Evolution Systems &#187; PHP</title>
	<atom:link href="http://evolution-systems.co.uk/tag/php/feed/" rel="self" type="application/rss+xml" />
	<link>http://evolution-systems.co.uk</link>
	<description>Web Development, Software Development and Linux Consultancy services</description>
	<lastBuildDate>Fri, 08 Aug 2025 09:18:44 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>https://wordpress.org/?v=4.1.42</generator>
	<item>
		<title>Nice PHP print_r Formatted Table Function</title>
		<link>http://evolution-systems.co.uk/2012/01/16/nice-php-print_r-formatted-table-function/</link>
		<comments>http://evolution-systems.co.uk/2012/01/16/nice-php-print_r-formatted-table-function/#comments</comments>
		<pubDate>Mon, 16 Jan 2012 18:58:46 +0000</pubDate>
		<dc:creator><![CDATA[Matthew Jakeman]]></dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[PHP Functions]]></category>
		<category><![CDATA[print_r]]></category>

		<guid isPermaLink="false">http://evolution-systems.co.uk/?p=654</guid>
		<description><![CDATA[Whilst looking through php.net I stumbled across the following function that will print out an array in a nicely formatted table. When dealing with lots of nested array something like this makes it much easier to see all of the data contained within an array.]]></description>
				<content:encoded><![CDATA[<p>Whilst looking through php.net I stumbled across the following function that will print out an array in a nicely formatted table. When dealing with lots of nested array something like this makes it much easier to see all of the data contained within an array.</p>
<pre class="brush: php; title: ; notranslate">
&lt;?php
 function print_nice($elem,$max_level=10,$print_nice_stack=array()){
 if(is_array($elem) || is_object($elem)){
 if(in_array(&amp;$elem,$print_nice_stack,true)){
 echo &quot;&lt;font color=red&gt;RECURSION&lt;/font&gt;&quot;;
 return;
 }
 $print_nice_stack[]=&amp;$elem;
 if($max_level&lt;1){
 echo &quot;&lt;font color=red&gt;nivel maximo alcanzado&lt;/font&gt;&quot;;
 return;
 }
 $max_level--;
 echo &quot;&lt;table border=1 cellspacing=0 cellpadding=3 width=100%&gt;&quot;;
 if(is_array($elem)){
 echo '&lt;tr&gt;&lt;td colspan=2  style=&quot;background-color:#333333;&quot;&gt;&lt;strong&gt;&lt;font  color=white&gt;ARRAY&lt;/font&gt;&lt;/strong&gt;&lt;/td&gt;&lt;/tr&gt;';
 }else{
 echo '&lt;tr&gt;&lt;td colspan=2 style=&quot;background-color:#333333;&quot;&gt;&lt;strong&gt;';
 echo '&lt;font color=white&gt;OBJECT Type: '.get_class($elem).'&lt;/font&gt;&lt;/strong&gt;&lt;/td&gt;&lt;/tr&gt;';
 }
 $color=0;
 foreach($elem as $k =&gt; $v){
 if($max_level%2){
 $rgb=($color++%2)?&quot;#888888&quot;:&quot;#BBBBBB&quot;;
 }else{
 $rgb=($color++%2)?&quot;#8888BB&quot;:&quot;#BBBBFF&quot;;
 }
 echo '&lt;tr&gt;&lt;td valign=&quot;top&quot; style=&quot;width:40px;background-color:'.$rgb.';&quot;&gt;';
 echo '&lt;strong&gt;'.$k.&quot;&lt;/strong&gt;&lt;/td&gt;&lt;td&gt;&quot;;
 print_nice($v,$max_level,$print_nice_stack);
 echo &quot;&lt;/td&gt;&lt;/tr&gt;&quot;;
 }
 echo &quot;&lt;/table&gt;&quot;;
 return;
 }
 if($elem === null){
 echo &quot;&lt;font color=green&gt;NULL&lt;/font&gt;&quot;;
 }elseif($elem === 0){
 echo &quot;0&quot;;
 }elseif($elem === true){
 echo &quot;&lt;font color=green&gt;TRUE&lt;/font&gt;&quot;;
 }elseif($elem === false){
 echo &quot;&lt;font color=green&gt;FALSE&lt;/font&gt;&quot;;
 }elseif($elem === &quot;&quot;){
 echo &quot;&lt;font color=green&gt;EMPTY STRING&lt;/font&gt;&quot;;
 }else{
 echo str_replace(&quot;\n&quot;,&quot;&lt;strong&gt;&lt;font color=red&gt;*&lt;/font&gt;&lt;/strong&gt;&lt;br&gt;\n&quot;,$elem);
 }
 }
 ?&gt;
</pre>
]]></content:encoded>
			<wfw:commentRss>http://evolution-systems.co.uk/2012/01/16/nice-php-print_r-formatted-table-function/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Resizing An Image With PHP</title>
		<link>http://evolution-systems.co.uk/2010/04/08/risizing-an-image-with-php-2/</link>
		<comments>http://evolution-systems.co.uk/2010/04/08/risizing-an-image-with-php-2/#comments</comments>
		<pubDate>Thu, 08 Apr 2010 18:32:24 +0000</pubDate>
		<dc:creator><![CDATA[Matthew Jakeman]]></dc:creator>
				<category><![CDATA[Matts Blog]]></category>
		<category><![CDATA[Web Development]]></category>
		<category><![CDATA[Image]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Resizing]]></category>

		<guid isPermaLink="false">http://evolution-systems.co.uk/wordpress/?p=464</guid>
		<description><![CDATA[I came across this PHP class today that is great for resizing images. It is extremely easy to use and quite a small class. The class file can be downloaded here: SimpleImage.php A quick example usage to show how simple it is&#8230; include('SimpleImage.php'); $image = new SimpleImage(); $image->load('picture.jpg'); $image->resize(250,400); $image->save('picture2.jpg'); The last time I had [&#8230;]]]></description>
				<content:encoded><![CDATA[<p>I came across this PHP class today that is great for resizing images. It is extremely easy to use and quite a small class. The class file can be downloaded here:</p>
<p><a href="http://www.evolution-systems.co.uk/files/SimpleImage.php">SimpleImage.php</a></p>
<p>A quick example usage to show how simple it is&#8230;</p>
<p><code>   include('SimpleImage.php');<br />   $image = new SimpleImage();<br />   $image->load('picture.jpg');<br />   $image->resize(250,400);<br />   $image->save('picture2.jpg');</code><br />
The last time I had to do some image resizing with PHP was a number of years ago and I seem to remember it being a lot more complicated than this.</p>
<p>Thanks to <a href="http://www.white-hat-web-design.co.uk/articles/php-image-resizing.php">White Hat Web Design</a> for making this little class and making it available.</p>
]]></content:encoded>
			<wfw:commentRss>http://evolution-systems.co.uk/2010/04/08/risizing-an-image-with-php-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Validating Url Strings In PHP</title>
		<link>http://evolution-systems.co.uk/2008/09/25/validating-url-strings-in-php-2/</link>
		<comments>http://evolution-systems.co.uk/2008/09/25/validating-url-strings-in-php-2/#comments</comments>
		<pubDate>Thu, 25 Sep 2008 12:25:31 +0000</pubDate>
		<dc:creator><![CDATA[Matthew Jakeman]]></dc:creator>
				<category><![CDATA[Evolution Systems]]></category>
		<category><![CDATA[Matts Blog]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[URL]]></category>
		<category><![CDATA[Validation]]></category>

		<guid isPermaLink="false">http://evolution-systems.co.uk/wordpress/?p=501</guid>
		<description><![CDATA[I was writing a form a little while ago that requests a url from a user. Obviously it would be nice to validate the string the user input in some way. I am not a fan of writing a regex for something like this when I know that there are bound to be many examples [&#8230;]]]></description>
				<content:encoded><![CDATA[<p>I was writing a form a little while ago that requests a url from a user. Obviously it would be nice to validate the string the user input in some way. I am not a fan of writing a regex for something like this when I know that there are bound to be many examples of doing this knocking about already so to save time I once again headed over to google to look around.</p>
<p>I came across <a href="http://www.phpcentral.com/208-url-validation-php.html">this link</a> which has a nice little example of a regex to achieve a good validation.</p>
<p>Below is a copy and paste of building the regex string from that site with brief explanations of what each part achieves.</p>
<p><code>// SCHEME<br />$urlregex = "^(https?|ftp)\:\/\/";</p>
<p>// USER AND PASS (optional)<br />$urlregex .= "([a-z0-9+!*(),;?&#038;=\$_.-]+(\:[a-z0-9+!*(),;?&#038;=\$_.-]+)?@)?";<br />// HOSTNAME OR IP<br />$urlregex .= "[a-z0-9+\$_-]+(\.[a-z0-9+\$_-]+)*";<br />// PORT (optional)<br />$urlregex .= "(\:[0-9]{2,5})?"; <br />// PATH  (optional)<br />$urlregex .= "(\/([a-z0-9+\$_-]\.?)+)*\/?";// GET Query (optional)<br />$urlregex .= "(\?[a-z+&#038;\$_.-][a-z0-9;:@/&#038;%=+\$_.-]*)?";// ANCHOR (optional)<br />$urlregex .= "(#[a-z_.-][a-z0-9+\$_.-]*)?\$";</code><br />
This builds a nice regex string which can be used with the eregi() function to validate a url string like so:</p>
<p><code>if (eregi($urlregex, $url))<br />{<br />  echo "URL Valid";<br />}<br />else<br />{<br />  echo "URL Invalid";<br />}</code><br />
This regex will validate nearly all valid url&#8217;s and is handy to have knocking about.</p>
<p>Thanks to the original author, whoever that may be&#8230;..</p>
]]></content:encoded>
			<wfw:commentRss>http://evolution-systems.co.uk/2008/09/25/validating-url-strings-in-php-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Get Next Auto Increment Value</title>
		<link>http://evolution-systems.co.uk/2008/09/24/get-next-auto-increment-value-2/</link>
		<comments>http://evolution-systems.co.uk/2008/09/24/get-next-auto-increment-value-2/#comments</comments>
		<pubDate>Wed, 24 Sep 2008 22:46:11 +0000</pubDate>
		<dc:creator><![CDATA[Matthew Jakeman]]></dc:creator>
				<category><![CDATA[Matts Blog]]></category>
		<category><![CDATA[Web Development]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://evolution-systems.co.uk/wordpress/?p=502</guid>
		<description><![CDATA[Earlier today I had the need to try and discover the next auto increment value in a MySQL table. I haven&#8217;t needed to do this before so I headed over to google to have a look for how to accomplish it. A lot of information I found said to use a &#8216;SELECT MAX&#8230;&#8217;. This would [&#8230;]]]></description>
				<content:encoded><![CDATA[<p>Earlier today I had the need to try and discover the next auto increment value in a MySQL table. I haven&#8217;t needed to do this before so I headed over to google to have a look for how to accomplish it.</p>
<p>A lot of information I found said to use a &#8216;SELECT MAX&#8230;&#8217;. This would work fine as long as nothing gets deleted from the end of the database. I ended up finding a nice blog entry <a href="http://blog.jamiedoris.com/geek/560/">here</a> that explains exactly how to do it. The following code snippet taken from the site above shows how to get the next value.</p>
<p><code><?php<br />$tablename 		= "tablename";<br />$next_increment 	= 0;<br />$qShowStatus 		= "SHOW TABLE STATUS LIKE '$tablename'";<br />$qShowStatusResult 	= mysql_query($qShowStatus);</p>
<p>$row = mysql_fetch_assoc($qShowStatusResult);<br />$next_increment = $row['Auto_increment'];</p>
<p>echo "next increment number: [$next_increment]";<br />
?></code></p>
<p>Quite a useful piece of info&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://evolution-systems.co.uk/2008/09/24/get-next-auto-increment-value-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Xajax</title>
		<link>http://evolution-systems.co.uk/2008/04/03/xajax-2/</link>
		<comments>http://evolution-systems.co.uk/2008/04/03/xajax-2/#comments</comments>
		<pubDate>Thu, 03 Apr 2008 15:08:32 +0000</pubDate>
		<dc:creator><![CDATA[Matthew Jakeman]]></dc:creator>
				<category><![CDATA[Matts Blog]]></category>
		<category><![CDATA[Web Development]]></category>
		<category><![CDATA[Ajax]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Toolkits]]></category>

		<guid isPermaLink="false">http://evolution-systems.co.uk/wordpress/?p=508</guid>
		<description><![CDATA[I have been doing some form submission for a site I am working on and was thinking it would be nice to use a bit of AJAX to check the forms and display altered content after the form had been submitted, as opposed to simply reloading the page with different parameters. I went on over [&#8230;]]]></description>
				<content:encoded><![CDATA[<p><img src="/blogs/matt/images/xajax.png" alt="Xajax Image" class="floatRightImage5" />I have been doing some form submission for a site I am working on and was thinking it would be nice to use a bit of AJAX to check the forms and display altered content after the form had been submitted, as opposed to simply reloading the page with different parameters.</p>
<p>I went on over to google and started searching to see if I could find any nice libraries that would make the job a little simpler and came across <a href="http://xajaxproject.org/">xajax</a>.</p>
<p>This is a really nice PHP toolkit that enables you to add ajax functionality into your web pages extremely easily. All you have to do is include the xajax libraries, create a new xajax object, register a function with the xajax object and include a call to the xajax registered function in your html form, on a button click for example.</p>
<p>Once inside the xajax function you can perform any processing you wish and then return a bunch of html code to be placed inside a container (a div for example) on the calling page.</p>
<p>There are some great little tutorials on the <a href="http://xajaxproject.org/">xajax homepage</a> to get you started on your way to lovely ajax enabled web pages.</p>
]]></content:encoded>
			<wfw:commentRss>http://evolution-systems.co.uk/2008/04/03/xajax-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Convert MySql timestamp field to Unix Time Stamp</title>
		<link>http://evolution-systems.co.uk/2008/03/20/convert-mysql-timestamp-field-to-unix-time-stamp-2/</link>
		<comments>http://evolution-systems.co.uk/2008/03/20/convert-mysql-timestamp-field-to-unix-time-stamp-2/#comments</comments>
		<pubDate>Thu, 20 Mar 2008 16:48:23 +0000</pubDate>
		<dc:creator><![CDATA[Matthew Jakeman]]></dc:creator>
				<category><![CDATA[Matts Blog]]></category>
		<category><![CDATA[Web Development]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[PHP Functions]]></category>
		<category><![CDATA[Time]]></category>

		<guid isPermaLink="false">http://evolution-systems.co.uk/wordpress/?p=511</guid>
		<description><![CDATA[As anyone who has used MySql and PHP in the past to deal with time and date will probably know MySql timestamp fields are not compatible in anyway with PHP&#8217;s date() function. Because of this you need to do conversions in order to use the information from the MySql database. The following function will convert [&#8230;]]]></description>
				<content:encoded><![CDATA[<p>As anyone who has used MySql and PHP in the past to deal with time and date will probably know MySql timestamp fields are not compatible in anyway with PHP&#8217;s date() function. Because of this you need to do conversions in order to use the information from the MySql database. The following function will convert a value from a database into a unix timestamp format for easier manipulation within your PHP code. I have found it quite useful to have around so am putting it up here for others to take advantage of.</p>
<p><code>/*<br />  * Convert MySql timestamp to unix timestamp<br />  */<br />function ts2unix($ts)<br />{<br />  $year    = substr($ts,0,4);<br />  $month   = substr($ts,4,2);<br />  $day     = substr($ts,6,2);<br />  $hour    = substr($ts,8,2);<br />  $minute  = substr($ts,10,2);<br />  $second  = substr($ts,12,2);<br />  $uts = mktime($hour,$minute,$second,$month,$day,$year);<br />  return ($uts);<br />}</code></p>
]]></content:encoded>
			<wfw:commentRss>http://evolution-systems.co.uk/2008/03/20/convert-mysql-timestamp-field-to-unix-time-stamp-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>RSS Script</title>
		<link>http://evolution-systems.co.uk/2008/03/18/rss-script-2/</link>
		<comments>http://evolution-systems.co.uk/2008/03/18/rss-script-2/#comments</comments>
		<pubDate>Tue, 18 Mar 2008 19:52:16 +0000</pubDate>
		<dc:creator><![CDATA[Matthew Jakeman]]></dc:creator>
				<category><![CDATA[Matts Blog]]></category>
		<category><![CDATA[Web Development]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[RSS]]></category>

		<guid isPermaLink="false">http://evolution-systems.co.uk/wordpress/?p=513</guid>
		<description><![CDATA[I decided this morning that I wanted to add an RSS feed to my blog for the hell of it. A quick trip over to google and I stumbled upon a nice little PHP class to do it all for me called FeedCreator. This class enables many different types of feeds to be created and [&#8230;]]]></description>
				<content:encoded><![CDATA[<p>I decided this morning that I wanted to add an RSS feed to my blog for the hell of it. A quick trip over to google and I stumbled upon a nice little PHP class to do it all for me called <a href="http://www.bitfolge.de/rsscreator-en.html">FeedCreator</a>.</p>
<p>This class enables many different types of feeds to be created and is extremely simple to use so thanks to Kai Blankenhorn for this I&#8217;m sure I will be using it again in the future.</p>
]]></content:encoded>
			<wfw:commentRss>http://evolution-systems.co.uk/2008/03/18/rss-script-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
