E-mail address validation using PHP preg_matchNovember 13, 2006 For PHP or Regular Expression (regex) newcomers, a single line of code used to validate e-mail addresses submitted by visitors to your site.
Regular expression matching can seem very daunting; the code certainly isn't self-explanatory. By way of introduction to the subject, we dissect this single line of code. We also explain the preg_match function in its simplest form, contrast PERL- and POSIX-compatible regex functions, and give you references so you can dig deeper.
[ Read more ... ]
PHP Script Timer finds the code that's choking you ...May 17, 2006 Code choking your server's CPU? Site visitors clicking away because your page is taking too long to respond? Do you know? Some code just plods. Retrieving and parsing remote files, image manipulations, multiple complex SQL queries, etc. grind down your site. Our PHP Script Timer identifies these bottlenecks. For example, you want to retrieve and parse a remote RSS news feed. Do you use a locally cached file copy if it's current enough? Do you not bother, and just use the remote feed each time? Does it matter? Using our walRuSS.php RSS feed reader gives us the following script execution times: xml_parser-based RSS feed reader, non-cached: 1.554 secs xml_parser based feed reader, cached: 0.0444 secs [ Read more ... ]
PHP micro-script displays PHP, HTML, Javascript code without parsingMay 6, 2006 It's almost embarrassing to release two lines of code as a script - but I haven't found anything similar anywhere else on the 'Net. It displays PHP, HTML, Javascript and other source code direct from file, unparsed, and presents it cleanly and professionally. An image link brands the displayed code, and refers viewers back to the main site. Complete functionality derives from one simple PHP function - htmlentities() - which converts all PHP, HTML and other tags to non-coding, display-only character codes, without parsing. Too easy. This PHP script is released under the terms of the GNU General Public License, i.e. free for you to use, modify, and even redistribute under the terms of this license. [ Read more ... ]
|