<?xml version="1.0" encoding="UTF-8"?><?xml-stylesheet type="text/xsl" href="http://www.bytemycode.com/rssformat.xsl"?><rss version="2.0" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/">
	<channel>
		<title>byteMyCode: Snippets for phpcode</title>
		<link>http://www.bytemycode.com</link>
		<description>Snippets for this tag.</description>
		<pubDate>Wed, 09 Jul 2008 08:52:41 +0000</pubDate>
		<copyright>1998-2008 </copyright>
		<language>en-us</language>
		<image>
		      <link>http://www.bytemycode.com</link>
		      <url>http://www.bytemycode.com/img/rss_title.gif</url>
		      <title>byteMyCode</title>
		</image>

	<item>
	<title>PHP Table Class</title>
	<link>http://www.bytemycode.com/snippets/snippet/419/</link>
	<comments>http://www.bytemycode.com/snippets/snippet/419/comments/</comments>
	<pubDate>Fri, 06 Oct 2006 09:25:48 +0000</pubDate>
	<dc:creator>BrandonReese</dc:creator>
	<category>PHP, phpcode</category>
	<guid isPermaLink="false">http://www.bytemycode.com/snippets/snippet/419/</guid>
	<description>
		<![CDATA[

			<img src="http://www.bytemycode.com/img/icon_calendar.gif" align="middle" class="icon" alt="Date Submitted" /> Fri. Oct. 6th, 2006  9:25 AM			<br />
			<img src="http://www.bytemycode.com/img/icon_revision.gif" align="middle" class="icon" alt="Revision" /> <a href="http://www.bytemycode.com/snippets/snippet/419/revisions/">1</a>
			<br />
			<img src="http://www.bytemycode.com/img/rank_helper.gif" align="middle" class="icon" alt="Helper" /> <a href="http://www.bytemycode.com/members/member/BrandonReese/" title="Helper">BrandonReese</a>
			<br />
			<img src="http://www.bytemycode.com/img/icon_tag.gif" align="middle" class="icon" alt="Tags" /> <a href="http://www.bytemycode.com/tags/tag/PHP">PHP</a>&nbsp;|&nbsp;<a href="http://www.bytemycode.com/tags/tag/phpcode">phpcode</a>			<br />
			<img src="http://www.bytemycode.com/img/icon_comments.gif" align="middle" class="icon" alt="Comments" /> <a href="http://www.bytemycode.com/snippets/snippet/419/comments/">4 comments</a>
			<br />
			<img src="http://www.bytemycode.com/img/icon_ranking.gif" align="middle" class="icon" alt="Ranking" /> 12
			<p>This is a class for generating HTML tables. It's kind of rough, but I thought somebody might want to do something with it.</p>
		]]>
	</description>
</item><item>
	<title>Regex functino to validate a URL</title>
	<link>http://www.bytemycode.com/snippets/snippet/404/</link>
	<comments>http://www.bytemycode.com/snippets/snippet/404/comments/</comments>
	<pubDate>Thu, 28 Sep 2006 15:43:49 +0000</pubDate>
	<dc:creator>ffxfiend</dc:creator>
	<category>"php", PHP, phpcode, RegExp</category>
	<guid isPermaLink="false">http://www.bytemycode.com/snippets/snippet/404/</guid>
	<description>
		<![CDATA[

			<img src="http://www.bytemycode.com/img/icon_calendar.gif" align="middle" class="icon" alt="Date Submitted" /> Thu. Sep. 28th, 2006  3:43 PM			<br />
			<img src="http://www.bytemycode.com/img/icon_revision.gif" align="middle" class="icon" alt="Revision" /> <a href="http://www.bytemycode.com/snippets/snippet/404/revisions/">1</a>
			<br />
			<img src="http://www.bytemycode.com/img/rank_helper.gif" align="middle" class="icon" alt="Helper" /> <a href="http://www.bytemycode.com/members/member/ffxfiend/" title="Helper">ffxfiend</a>
			<br />
			<img src="http://www.bytemycode.com/img/icon_tag.gif" align="middle" class="icon" alt="Tags" /> <a href="http://www.bytemycode.com/tags/tag/%22php%22">"php"</a>&nbsp;|&nbsp;<a href="http://www.bytemycode.com/tags/tag/PHP">PHP</a>&nbsp;|&nbsp;<a href="http://www.bytemycode.com/tags/tag/phpcode">phpcode</a>&nbsp;|&nbsp;<a href="http://www.bytemycode.com/tags/tag/RegExp">RegExp</a>			<br />
			<img src="http://www.bytemycode.com/img/icon_comments.gif" align="middle" class="icon" alt="Comments" /> <a href="http://www.bytemycode.com/snippets/snippet/404/comments/">1 comments</a>
			<br />
			<img src="http://www.bytemycode.com/img/icon_ranking.gif" align="middle" class="icon" alt="Ranking" /> -11
			<p>This is a faily simple function to validate a URL being passed into your scripts. It will allow for http, https, and ftp. The beginning www. of a URL is optional as well. It will also validate if you have an IP address in place of the domain name. I'm sure this can be improved upon as this is my first attempt at regular expressions but it has worked good for me so far. Please comment or improve if your able. <br /><br />Thanks!</p>
		]]>
	</description>
</item><item>
	<title>Generate a random ID</title>
	<link>http://www.bytemycode.com/snippets/snippet/387/</link>
	<comments>http://www.bytemycode.com/snippets/snippet/387/comments/</comments>
	<pubDate>Fri, 22 Sep 2006 07:06:40 +0000</pubDate>
	<dc:creator>ffxfiend</dc:creator>
	<category>"Random Generation", PHP, phpcode</category>
	<guid isPermaLink="false">http://www.bytemycode.com/snippets/snippet/387/</guid>
	<description>
		<![CDATA[

			<img src="http://www.bytemycode.com/img/icon_calendar.gif" align="middle" class="icon" alt="Date Submitted" /> Fri. Sep. 22nd, 2006  7:06 AM			<br />
			<img src="http://www.bytemycode.com/img/icon_revision.gif" align="middle" class="icon" alt="Revision" /> <a href="http://www.bytemycode.com/snippets/snippet/387/revisions/">1</a>
			<br />
			<img src="http://www.bytemycode.com/img/rank_helper.gif" align="middle" class="icon" alt="Helper" /> <a href="http://www.bytemycode.com/members/member/ffxfiend/" title="Helper">ffxfiend</a>
			<br />
			<img src="http://www.bytemycode.com/img/icon_tag.gif" align="middle" class="icon" alt="Tags" /> <a href="http://www.bytemycode.com/tags/tag/%22Random+Generation%22">"Random Generation"</a>&nbsp;|&nbsp;<a href="http://www.bytemycode.com/tags/tag/PHP">PHP</a>&nbsp;|&nbsp;<a href="http://www.bytemycode.com/tags/tag/phpcode">phpcode</a>			<br />
			<img src="http://www.bytemycode.com/img/icon_comments.gif" align="middle" class="icon" alt="Comments" /> <a href="http://www.bytemycode.com/snippets/snippet/387/comments/">5 comments</a>
			<br />
			<img src="http://www.bytemycode.com/img/icon_ranking.gif" align="middle" class="icon" alt="Ranking" /> 26
			<p>This is a simple function to generate a random ID of letters and numbers however long you want. All you do is pass it how many parts you want and then how many pieces(chars/numbers) per part you want. <br /><br />I hope you enjoy <img src="http://www.bytemycode.com/img/wysiwyg/emo-smile.gif" /></p>
		]]>
	</description>
</item><item>
	<title>Resize an Image</title>
	<link>http://www.bytemycode.com/snippets/snippet/365/</link>
	<comments>http://www.bytemycode.com/snippets/snippet/365/comments/</comments>
	<pubDate>Sun, 17 Sep 2006 09:05:55 +0000</pubDate>
	<dc:creator>ffxfiend</dc:creator>
	<category>"images", PHP, phpcode</category>
	<guid isPermaLink="false">http://www.bytemycode.com/snippets/snippet/365/</guid>
	<description>
		<![CDATA[

			<img src="http://www.bytemycode.com/img/icon_calendar.gif" align="middle" class="icon" alt="Date Submitted" /> Sun. Sep. 17th, 2006  9:05 AM			<br />
			<img src="http://www.bytemycode.com/img/icon_revision.gif" align="middle" class="icon" alt="Revision" /> <a href="http://www.bytemycode.com/snippets/snippet/365/revisions/">1</a>
			<br />
			<img src="http://www.bytemycode.com/img/rank_helper.gif" align="middle" class="icon" alt="Helper" /> <a href="http://www.bytemycode.com/members/member/ffxfiend/" title="Helper">ffxfiend</a>
			<br />
			<img src="http://www.bytemycode.com/img/icon_tag.gif" align="middle" class="icon" alt="Tags" /> <a href="http://www.bytemycode.com/tags/tag/%22images%22">"images"</a>&nbsp;|&nbsp;<a href="http://www.bytemycode.com/tags/tag/PHP">PHP</a>&nbsp;|&nbsp;<a href="http://www.bytemycode.com/tags/tag/phpcode">phpcode</a>			<br />
			<img src="http://www.bytemycode.com/img/icon_comments.gif" align="middle" class="icon" alt="Comments" /> <a href="http://www.bytemycode.com/snippets/snippet/365/comments/">3 comments</a>
			<br />
			<img src="http://www.bytemycode.com/img/icon_ranking.gif" align="middle" class="icon" alt="Ranking" /> 11
			<p>You can use this function to dynamically generate html "width/height" for use with displaying a thumbnail image usingthe original image. This will help save in making dup images just for display as a thumbnail.<br /><br />It takes two arguments, the path to where the image is stored and the desired width or height.<br /><br />Please comment or improve this code <img src="http://www.bytemycode.com/img/wysiwyg/emo-bigsmile.gif" />.</p>
		]]>
	</description>
</item><item>
	<title>SQL Injection Protection</title>
	<link>http://www.bytemycode.com/snippets/snippet/318/</link>
	<comments>http://www.bytemycode.com/snippets/snippet/318/comments/</comments>
	<pubDate>Fri, 25 Aug 2006 03:58:42 +0000</pubDate>
	<dc:creator>Cyber-Drugs</dc:creator>
	<category>???, mysql_escape_string, phpcode</category>
	<guid isPermaLink="false">http://www.bytemycode.com/snippets/snippet/318/</guid>
	<description>
		<![CDATA[

			<img src="http://www.bytemycode.com/img/icon_calendar.gif" align="middle" class="icon" alt="Date Submitted" /> Fri. Aug. 25th, 2006  3:58 AM			<br />
			<img src="http://www.bytemycode.com/img/icon_revision.gif" align="middle" class="icon" alt="Revision" /> <a href="http://www.bytemycode.com/snippets/snippet/318/revisions/">1</a>
			<br />
			<img src="http://www.bytemycode.com/img/rank_helper.gif" align="middle" class="icon" alt="Helper" /> <a href="http://www.bytemycode.com/members/member/Cyber-Drugs/" title="Helper">Cyber-Drugs</a>
			<br />
			<img src="http://www.bytemycode.com/img/icon_tag.gif" align="middle" class="icon" alt="Tags" /> <a href="http://www.bytemycode.com/tags/tag/%3F%3F%3F">???</a>&nbsp;|&nbsp;<a href="http://www.bytemycode.com/tags/tag/mysql_escape_string">mysql_escape_string</a>&nbsp;|&nbsp;<a href="http://www.bytemycode.com/tags/tag/phpcode">phpcode</a>			<br />
			<img src="http://www.bytemycode.com/img/icon_comments.gif" align="middle" class="icon" alt="Comments" /> <a href="http://www.bytemycode.com/snippets/snippet/318/comments/">0 comments</a>
			<br />
			<img src="http://www.bytemycode.com/img/icon_ranking.gif" align="middle" class="icon" alt="Ranking" /> 9
			<p>The below may be a simple line of code, but it is extremely useful to help prevent SQL Injection. There are many other methods, such as removing certain values from your string, but this is by far superior, as it does not limit what can be inserted to your database.</p>
		]]>
	</description>
</item><item>
	<title>Creating Dynamic Image Thumbnail</title>
	<link>http://www.bytemycode.com/snippets/snippet/317/</link>
	<comments>http://www.bytemycode.com/snippets/snippet/317/comments/</comments>
	<pubDate>Fri, 25 Aug 2006 03:55:18 +0000</pubDate>
	<dc:creator>Cyber-Drugs</dc:creator>
	<category>???, phpcode</category>
	<guid isPermaLink="false">http://www.bytemycode.com/snippets/snippet/317/</guid>
	<description>
		<![CDATA[

			<img src="http://www.bytemycode.com/img/icon_calendar.gif" align="middle" class="icon" alt="Date Submitted" /> Fri. Aug. 25th, 2006  3:55 AM			<br />
			<img src="http://www.bytemycode.com/img/icon_revision.gif" align="middle" class="icon" alt="Revision" /> <a href="http://www.bytemycode.com/snippets/snippet/317/revisions/">1</a>
			<br />
			<img src="http://www.bytemycode.com/img/rank_helper.gif" align="middle" class="icon" alt="Helper" /> <a href="http://www.bytemycode.com/members/member/Cyber-Drugs/" title="Helper">Cyber-Drugs</a>
			<br />
			<img src="http://www.bytemycode.com/img/icon_tag.gif" align="middle" class="icon" alt="Tags" /> <a href="http://www.bytemycode.com/tags/tag/%3F%3F%3F">???</a>&nbsp;|&nbsp;<a href="http://www.bytemycode.com/tags/tag/phpcode">phpcode</a>			<br />
			<img src="http://www.bytemycode.com/img/icon_comments.gif" align="middle" class="icon" alt="Comments" /> <a href="http://www.bytemycode.com/snippets/snippet/317/comments/">0 comments</a>
			<br />
			<img src="http://www.bytemycode.com/img/icon_ranking.gif" align="middle" class="icon" alt="Ranking" /> 5
			<p>Before any wars start, I want to clarify that the code below is NOT my own code, but unfortunately I am uncertain where I obtained it from. The code below basically create dynamic thumbnails of an image, you parse the following to it:<br /><br />Image location,<br />Maximum Width<br />Maximum Height<br /><br />It will then scale your image down, please do not confuse this with converting your image into a square, or whatever shape you are after. The code below will maintain aspect ratio of your image, and will use the values you parse as a guidline. Extremely handy when you are building gallery websites.</p>
		]]>
	</description>
</item><item>
	<title>Testing MySQL Database Connection</title>
	<link>http://www.bytemycode.com/snippets/snippet/316/</link>
	<comments>http://www.bytemycode.com/snippets/snippet/316/comments/</comments>
	<pubDate>Fri, 25 Aug 2006 03:50:08 +0000</pubDate>
	<dc:creator>Cyber-Drugs</dc:creator>
	<category>???, die, if, mysql_connect, mysql_error, phpcode</category>
	<guid isPermaLink="false">http://www.bytemycode.com/snippets/snippet/316/</guid>
	<description>
		<![CDATA[

			<img src="http://www.bytemycode.com/img/icon_calendar.gif" align="middle" class="icon" alt="Date Submitted" /> Fri. Aug. 25th, 2006  3:50 AM			<br />
			<img src="http://www.bytemycode.com/img/icon_revision.gif" align="middle" class="icon" alt="Revision" /> <a href="http://www.bytemycode.com/snippets/snippet/316/revisions/">1</a>
			<br />
			<img src="http://www.bytemycode.com/img/rank_helper.gif" align="middle" class="icon" alt="Helper" /> <a href="http://www.bytemycode.com/members/member/Cyber-Drugs/" title="Helper">Cyber-Drugs</a>
			<br />
			<img src="http://www.bytemycode.com/img/icon_tag.gif" align="middle" class="icon" alt="Tags" /> <a href="http://www.bytemycode.com/tags/tag/%3F%3F%3F">???</a>&nbsp;|&nbsp;<a href="http://www.bytemycode.com/tags/tag/die">die</a>&nbsp;|&nbsp;<a href="http://www.bytemycode.com/tags/tag/if">if</a>&nbsp;|&nbsp;<a href="http://www.bytemycode.com/tags/tag/mysql_connect">mysql_connect</a>&nbsp;|&nbsp;<a href="http://www.bytemycode.com/tags/tag/mysql_error">mysql_error</a>&nbsp;|&nbsp;<a href="http://www.bytemycode.com/tags/tag/phpcode">phpcode</a>			<br />
			<img src="http://www.bytemycode.com/img/icon_comments.gif" align="middle" class="icon" alt="Comments" /> <a href="http://www.bytemycode.com/snippets/snippet/316/comments/">0 comments</a>
			<br />
			<img src="http://www.bytemycode.com/img/icon_ranking.gif" align="middle" class="icon" alt="Ranking" /> 5
			<p>Below is a very simple bit of code you can use to test a MySQL Database Connection.</p>
		]]>
	</description>
</item><item>
	<title>Load File, Remove last few lines</title>
	<link>http://www.bytemycode.com/snippets/snippet/315/</link>
	<comments>http://www.bytemycode.com/snippets/snippet/315/comments/</comments>
	<pubDate>Fri, 25 Aug 2006 03:44:44 +0000</pubDate>
	<dc:creator>Cyber-Drugs</dc:creator>
	<category>???, function, implode, phpcode, return, unset, while</category>
	<guid isPermaLink="false">http://www.bytemycode.com/snippets/snippet/315/</guid>
	<description>
		<![CDATA[

			<img src="http://www.bytemycode.com/img/icon_calendar.gif" align="middle" class="icon" alt="Date Submitted" /> Fri. Aug. 25th, 2006  3:44 AM			<br />
			<img src="http://www.bytemycode.com/img/icon_revision.gif" align="middle" class="icon" alt="Revision" /> <a href="http://www.bytemycode.com/snippets/snippet/315/revisions/">1</a>
			<br />
			<img src="http://www.bytemycode.com/img/rank_helper.gif" align="middle" class="icon" alt="Helper" /> <a href="http://www.bytemycode.com/members/member/Cyber-Drugs/" title="Helper">Cyber-Drugs</a>
			<br />
			<img src="http://www.bytemycode.com/img/icon_tag.gif" align="middle" class="icon" alt="Tags" /> <a href="http://www.bytemycode.com/tags/tag/%3F%3F%3F">???</a>&nbsp;|&nbsp;<a href="http://www.bytemycode.com/tags/tag/function">function</a>&nbsp;|&nbsp;<a href="http://www.bytemycode.com/tags/tag/implode">implode</a>&nbsp;|&nbsp;<a href="http://www.bytemycode.com/tags/tag/phpcode">phpcode</a>&nbsp;|&nbsp;<a href="http://www.bytemycode.com/tags/tag/return">return</a>&nbsp;|&nbsp;<a href="http://www.bytemycode.com/tags/tag/unset">unset</a>&nbsp;|&nbsp;<a href="http://www.bytemycode.com/tags/tag/while">while</a>			<br />
			<img src="http://www.bytemycode.com/img/icon_comments.gif" align="middle" class="icon" alt="Comments" /> <a href="http://www.bytemycode.com/snippets/snippet/315/comments/">0 comments</a>
			<br />
			<img src="http://www.bytemycode.com/img/icon_ranking.gif" align="middle" class="icon" alt="Ranking" /> 2
			<p>Below is a bit of code, which I needed to make when creating an application which did a lot of file manipulation. If you ever want to load the contents of a file, but remove X amount of lines from the end of the file, use the function below.</p>
		]]>
	</description>
</item><item>
	<title>Convert DOB to Age</title>
	<link>http://www.bytemycode.com/snippets/snippet/314/</link>
	<comments>http://www.bytemycode.com/snippets/snippet/314/comments/</comments>
	<pubDate>Fri, 25 Aug 2006 03:41:12 +0000</pubDate>
	<dc:creator>Cyber-Drugs</dc:creator>
	<category>???, else, function, if, phpcode, return</category>
	<guid isPermaLink="false">http://www.bytemycode.com/snippets/snippet/314/</guid>
	<description>
		<![CDATA[

			<img src="http://www.bytemycode.com/img/icon_calendar.gif" align="middle" class="icon" alt="Date Submitted" /> Fri. Aug. 25th, 2006  3:41 AM			<br />
			<img src="http://www.bytemycode.com/img/icon_revision.gif" align="middle" class="icon" alt="Revision" /> <a href="http://www.bytemycode.com/snippets/snippet/314/revisions/">1</a>
			<br />
			<img src="http://www.bytemycode.com/img/rank_helper.gif" align="middle" class="icon" alt="Helper" /> <a href="http://www.bytemycode.com/members/member/Cyber-Drugs/" title="Helper">Cyber-Drugs</a>
			<br />
			<img src="http://www.bytemycode.com/img/icon_tag.gif" align="middle" class="icon" alt="Tags" /> <a href="http://www.bytemycode.com/tags/tag/%3F%3F%3F">???</a>&nbsp;|&nbsp;<a href="http://www.bytemycode.com/tags/tag/else">else</a>&nbsp;|&nbsp;<a href="http://www.bytemycode.com/tags/tag/function">function</a>&nbsp;|&nbsp;<a href="http://www.bytemycode.com/tags/tag/if">if</a>&nbsp;|&nbsp;<a href="http://www.bytemycode.com/tags/tag/phpcode">phpcode</a>&nbsp;|&nbsp;<a href="http://www.bytemycode.com/tags/tag/return">return</a>			<br />
			<img src="http://www.bytemycode.com/img/icon_comments.gif" align="middle" class="icon" alt="Comments" /> <a href="http://www.bytemycode.com/snippets/snippet/314/comments/">0 comments</a>
			<br />
			<img src="http://www.bytemycode.com/img/icon_ranking.gif" align="middle" class="icon" alt="Ranking" /> 1
			<p>The below is an old bit of code I threw together when I was developing a Friend Networking site back in 2001. The site didn't last all that long, but I did manage to save all the handy snippets I used in it.<br /><br />Below is code, which will return the age of somebody, when you parse their date of birth to it. I will probably make a cleaner version of the code at a later date and share it with everyone here.</p>
		]]>
	</description>
</item>
	</channel>
</rss>