<?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>JayGilford.com &#187; PHP</title>
	<atom:link href="http://www.jaygilford.com/category/php/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.jaygilford.com</link>
	<description>Numerous articles on PHP, MySQL and Apache files</description>
	<lastBuildDate>Wed, 03 Feb 2010 20:07:47 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Simple timer class for benchmarking in PHP</title>
		<link>http://www.jaygilford.com/php/simple-timer-class-for-benchmarking/</link>
		<comments>http://www.jaygilford.com/php/simple-timer-class-for-benchmarking/#comments</comments>
		<pubDate>Wed, 03 Feb 2010 19:46:04 +0000</pubDate>
		<dc:creator>Jay</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[benchmarking]]></category>
		<category><![CDATA[class]]></category>
		<category><![CDATA[simple]]></category>
		<category><![CDATA[timer]]></category>

		<guid isPermaLink="false">http://www.jaygilford.com/?p=113</guid>
		<description><![CDATA[Here&#8217;s a simple timer class that I wrote to help with benchmarking tests while running PHP code, in order to see how quick code is running, although it can be used for any timer functionality really. I have clearly documented the code below, along with an example of how to use the timer


PHP Code
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
/*******************************************************************************
*  [...]]]></description>
		<wfw:commentRss>http://www.jaygilford.com/php/simple-timer-class-for-benchmarking/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Using the PHP Document Object Model (DOM) to get all page links</title>
		<link>http://www.jaygilford.com/php/php-dom-get-all-pagelinks/</link>
		<comments>http://www.jaygilford.com/php/php-dom-get-all-pagelinks/#comments</comments>
		<pubDate>Wed, 27 Jan 2010 16:27:03 +0000</pubDate>
		<dc:creator>Jay</dc:creator>
				<category><![CDATA[Common questions]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Document Object Model]]></category>
		<category><![CDATA[DOM]]></category>
		<category><![CDATA[DOMDocument]]></category>
		<category><![CDATA[Friends]]></category>

		<guid isPermaLink="false">http://www.jaygilford.com/?p=103</guid>
		<description><![CDATA[Further to the article I wrote about parsing links from a html page, here is a more elegant and accurate solution to getting every link using the Document Object Model (DOM)

PHP Code
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
/**
 * @author Jay Gilford
 */
&#160;
/**
 * get_links()
 * 
 * @param string $url
 * @return array
 */
function get_links&#40;$url&#41; &#123;
&#160;
    // [...]]]></description>
		<wfw:commentRss>http://www.jaygilford.com/php/php-dom-get-all-pagelinks/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Number to text converting PHP class</title>
		<link>http://www.jaygilford.com/php/number-to-text-converting-php-class/</link>
		<comments>http://www.jaygilford.com/php/number-to-text-converting-php-class/#comments</comments>
		<pubDate>Mon, 02 Nov 2009 14:19:42 +0000</pubDate>
		<dc:creator>Jay</dc:creator>
				<category><![CDATA[Common questions]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[class]]></category>
		<category><![CDATA[common]]></category>
		<category><![CDATA[numbers]]></category>
		<category><![CDATA[text]]></category>

		<guid isPermaLink="false">http://www.jaygilford.com/?p=89</guid>
		<description><![CDATA[One thing that gets asked quite a bit on forums is how to convert a number into words in PHP, so I thought I&#8217;d write a small class that can do this

Here is the code for the class

PHP Code
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
class num2text &#123;
    private $_original = 0;
    private $_parsed_number_text = '';
 [...]]]></description>
		<wfw:commentRss>http://www.jaygilford.com/php/number-to-text-converting-php-class/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>how to get all links from a web page</title>
		<link>http://www.jaygilford.com/php/common-questions/how-to-get-all-links-from-a-web-page/</link>
		<comments>http://www.jaygilford.com/php/common-questions/how-to-get-all-links-from-a-web-page/#comments</comments>
		<pubDate>Mon, 26 Oct 2009 00:13:46 +0000</pubDate>
		<dc:creator>Jay</dc:creator>
				<category><![CDATA[Common questions]]></category>
		<category><![CDATA[content]]></category>
		<category><![CDATA[Friends]]></category>
		<category><![CDATA[page]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[urls]]></category>

		<guid isPermaLink="false">http://www.jaygilford.com/?p=85</guid>
		<description><![CDATA[A question that gets asked all the time on forums is &#8220;How do I get all links on a web page&#8221; inside of &#60;a&#62; tags, so here&#8217;s some code with full commenting for each line

PHP Code
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
/**
 * @author Jay Gilford
 */
&#160;
// regular expression pattern to match all links on a page
$pattern = '%&#60;a [^&#62;]+href=&#34;(?P&#60;url&#62;[^&#34;]+)&#34;[^&#62;*]*&#62;(?P&#60;text&#62;[^&#60; ]+)&#60;/a&#62;%si';
&#160;
// [...]]]></description>
		<wfw:commentRss>http://www.jaygilford.com/php/common-questions/how-to-get-all-links-from-a-web-page/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Completely customisable PHP pagination class</title>
		<link>http://www.jaygilford.com/php/completely-customisable-php-pagination-class/</link>
		<comments>http://www.jaygilford.com/php/completely-customisable-php-pagination-class/#comments</comments>
		<pubDate>Mon, 12 Jan 2009 21:36:48 +0000</pubDate>
		<dc:creator>Jay</dc:creator>
				<category><![CDATA[MySQL]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[advanced]]></category>
		<category><![CDATA[class]]></category>
		<category><![CDATA[object]]></category>
		<category><![CDATA[paginate]]></category>
		<category><![CDATA[pagination]]></category>

		<guid isPermaLink="false">http://www.jaygilford.com/?p=68</guid>
		<description><![CDATA[If you need to paginate your database results quickly and reliably then this could be the class for you. It allows you complete access to all attributes of the pagination, from the link templates to the results padding, and auto querying.


PHP Code
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
/*******************************************************************************
*              [...]]]></description>
		<wfw:commentRss>http://www.jaygilford.com/php/completely-customisable-php-pagination-class/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Gracefully handling errors in php using advanced techniques</title>
		<link>http://www.jaygilford.com/php/gracefully-handling-errors-in-php-using-advanced-techniques/</link>
		<comments>http://www.jaygilford.com/php/gracefully-handling-errors-in-php-using-advanced-techniques/#comments</comments>
		<pubDate>Sat, 11 Oct 2008 20:31:08 +0000</pubDate>
		<dc:creator>Jay</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[advanced]]></category>
		<category><![CDATA[error]]></category>
		<category><![CDATA[error handling]]></category>
		<category><![CDATA[techniques]]></category>

		<guid isPermaLink="false">http://www.jaygilford.com/?p=45</guid>
		<description><![CDATA[There are a few ways in which you can handle errors in PHP. You can do the not so smart thing and just turn them off altogether using

PHP Code
1
2
3
ini_set&#40;'error_reporting',0&#41;;
//or
error_reporting&#40;0&#41;;

However this is not a good idea, and should never happen. If you want to hide all of your errors, you can set it so that you [...]]]></description>
		<wfw:commentRss>http://www.jaygilford.com/php/gracefully-handling-errors-in-php-using-advanced-techniques/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>sprintf and mysql_real_escape_string all in one function</title>
		<link>http://www.jaygilford.com/php/sprintf-and-mysql_real_escape_string-all-in-one-function/</link>
		<comments>http://www.jaygilford.com/php/sprintf-and-mysql_real_escape_string-all-in-one-function/#comments</comments>
		<pubDate>Wed, 08 Oct 2008 19:23:37 +0000</pubDate>
		<dc:creator>Jay</dc:creator>
				<category><![CDATA[MySQL]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[call_user_func_array]]></category>
		<category><![CDATA[mressf]]></category>
		<category><![CDATA[mysql_real_escape_string]]></category>
		<category><![CDATA[sprintf]]></category>

		<guid isPermaLink="false">http://www.jaygilford.com/?p=40</guid>
		<description><![CDATA[Well as many php developers will know, there is the arduous task of having to sanitize all of your data before actually being able to add it to your queries for running in MySQL. So I decided to make a small function that would basically be a clone of the sprintf function, with the added [...]]]></description>
		<wfw:commentRss>http://www.jaygilford.com/php/sprintf-and-mysql_real_escape_string-all-in-one-function/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>random redirects to sites with php script</title>
		<link>http://www.jaygilford.com/php/random-redirects-to-sites-with-php-script/</link>
		<comments>http://www.jaygilford.com/php/random-redirects-to-sites-with-php-script/#comments</comments>
		<pubDate>Sun, 28 Sep 2008 18:53:45 +0000</pubDate>
		<dc:creator>Jay</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[random]]></category>
		<category><![CDATA[redirect]]></category>
		<category><![CDATA[script]]></category>

		<guid isPermaLink="false">http://www.jaygilford.com/?p=26</guid>
		<description><![CDATA[I was asked to create a script that would produce an even number of visits to each of three sites. I decided that I would skip the checking of making sure each site had a fair amount and instead generate the url randomly, since by the laws of averages, the number of redirects to each [...]]]></description>
		<wfw:commentRss>http://www.jaygilford.com/php/random-redirects-to-sites-with-php-script/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>creating random activation links for downloads</title>
		<link>http://www.jaygilford.com/php/creating-random-activation-links-for-downloads/</link>
		<comments>http://www.jaygilford.com/php/creating-random-activation-links-for-downloads/#comments</comments>
		<pubDate>Mon, 21 Jul 2008 18:59:57 +0000</pubDate>
		<dc:creator>Jay</dc:creator>
				<category><![CDATA[MySQL]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[activation]]></category>
		<category><![CDATA[download]]></category>
		<category><![CDATA[Friends]]></category>
		<category><![CDATA[random]]></category>
		<category><![CDATA[script]]></category>

		<guid isPermaLink="false">http://www.jaygilford.com/?p=15</guid>
		<description><![CDATA[This article is intended for advanced users. It explains the principles behind creating a download activation link that is completely random and will stay active for 48 hours after a payment through paypal for example is made
You are going to need two files for this to work. The first is going to be the file [...]]]></description>
		<wfw:commentRss>http://www.jaygilford.com/php/creating-random-activation-links-for-downloads/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>php random string generator function</title>
		<link>http://www.jaygilford.com/php/php-random-string-generator-function/</link>
		<comments>http://www.jaygilford.com/php/php-random-string-generator-function/#comments</comments>
		<pubDate>Wed, 16 Jul 2008 14:04:48 +0000</pubDate>
		<dc:creator>Jay</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[function]]></category>
		<category><![CDATA[random]]></category>
		<category><![CDATA[string]]></category>

		<guid isPermaLink="false">http://www.jaygilford.com/?p=14</guid>
		<description><![CDATA[Many people need a random string for things such as salts, activation keys and new passwords. Here&#8217;s a simple but versatile function to return a random string

PHP Code
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
function rand_text&#40;   $min = 10,
                      [...]]]></description>
		<wfw:commentRss>http://www.jaygilford.com/php/php-random-string-generator-function/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to get incoming email via PHP and cPanel</title>
		<link>http://www.jaygilford.com/php/incoming-email-via-php-and-cpanel/</link>
		<comments>http://www.jaygilford.com/php/incoming-email-via-php-and-cpanel/#comments</comments>
		<pubDate>Tue, 24 Jun 2008 01:55:59 +0000</pubDate>
		<dc:creator>Jay</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[php email cpanel]]></category>

		<guid isPermaLink="false">http://www.jaygilford.com/?p=12</guid>
		<description><![CDATA[This may be possible to do with other control panel software such as plesk, although I have only done so with cPanel

Open your cPanel homepage, and navigate to the Mail panel
Select the Default Address option
At the bottom of the page, click the Advanced Options »
Select the Pipe to a Program: radio option
In the text field, [...]]]></description>
		<wfw:commentRss>http://www.jaygilford.com/php/incoming-email-via-php-and-cpanel/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>how to process a form with php using one page</title>
		<link>http://www.jaygilford.com/php/how-to-process-a-form-with-php-using-one-page/</link>
		<comments>http://www.jaygilford.com/php/how-to-process-a-form-with-php-using-one-page/#comments</comments>
		<pubDate>Tue, 24 Jun 2008 01:15:33 +0000</pubDate>
		<dc:creator>Jay</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[form]]></category>
		<category><![CDATA[page]]></category>
		<category><![CDATA[post]]></category>
		<category><![CDATA[same]]></category>
		<category><![CDATA[xhtml]]></category>

		<guid isPermaLink="false">http://www.jaygilford.com/?p=11</guid>
		<description><![CDATA[Many first time coders in PHP tend to use a form on one page, and a PHP script on a completely different page in order to process it. This is highly irritating since you need to make two pages instead of one, and also, if there is an error you have to redirect back to [...]]]></description>
		<wfw:commentRss>http://www.jaygilford.com/php/how-to-process-a-form-with-php-using-one-page/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Headers already sent error php solution</title>
		<link>http://www.jaygilford.com/php/headers-already-sent-error-php-solution/</link>
		<comments>http://www.jaygilford.com/php/headers-already-sent-error-php-solution/#comments</comments>
		<pubDate>Sat, 21 Jun 2008 23:39:18 +0000</pubDate>
		<dc:creator>Jay</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[cookies]]></category>
		<category><![CDATA[headers]]></category>
		<category><![CDATA[location]]></category>
		<category><![CDATA[sent]]></category>

		<guid isPermaLink="false">http://www.jaygilford.com/?p=9</guid>
		<description><![CDATA[Many people seem to get a problem with the common error message of
Warning: Cannot modify header information - headers already sent by (output started at C:\file.php:1) in C:\file.php on line 4)
There are a number of possible reasons for why this might happen
Output before the &#60;?php tag
There are so many occasions where people report that they [...]]]></description>
		<wfw:commentRss>http://www.jaygilford.com/php/headers-already-sent-error-php-solution/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
