News Feed
Sections




News Archive
Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

PHPMaster.com:
An Introduction to Ctype Functions
April 30, 2013 @ 11:38:32

On PHPMaster.com today David Shirey has a written up a new tutorial introducing the ctype functions in PHP. This set of functions provides a handy way to more correctly check values to ensure they're valid (and contain what they should).

If you have a background in C, then you're probably already familiar with the character type functions because that is where they come from (don't forget that PHP is actually written in C). But if you're into Python, then it's only fair to point out that the PHP Ctype functions have absolutely nothing to do with the Python's ctypes library. It's just one of those tragic and totally unavoidable naming similarities.

He briefly explains how the functions work and at least one "gotcha" to watch out for if you're using them for input validation. He then goes through the list of the eleven ctype functions and briefly describes what they do. Some example code is also included showing how you can use them to validate a value based on the true/false return from the function call.

0 comments voice your opinion now!
ctype function introduction tutorial character type

Link: http://phpmaster.com/an-introduction-to-ctype-functions

blog comments powered by Disqus

Similar Posts

Maarten Balliauw's Blog: Using Windows Azure Drive in PHP (or Ruby)

Script-Tutorials.com: How to parse web pages using XPath

Fabien Potencier's Blog: The state of YAML in PHP

PHPMaster.com: Getting Started with Fuel CMS, Part 1

Padraic Brady's Blog: Mysteries Of Asynchronous Processing w/PHP - Pt 3: Spawned Child Processes


Community Events





Don't see your event here?
Let us know!


interview library list opinion api community tips introduction release voicesoftheelephpant deployment bugfix package language symfony podcast series laravel framework install

All content copyright, 2014 PHPDeveloper.org :: info@phpdeveloper.org - Powered by the Solar PHP Framework