Skip to content

Instantly share code, notes, and snippets.

@joshuapowell
Created April 12, 2011 02:01
Show Gist options
  • Save joshuapowell/914778 to your computer and use it in GitHub Desktop.
Save joshuapowell/914778 to your computer and use it in GitHub Desktop.
Check if a value is a number, if it is print it out and keep going, other wise return FALSE
<?php
/**
* Check if a value is a number, if it is print it out and keep going, other wise return FALSE
*
* @param (string) $number
* @return (mixed) boolean/$number
*/
function is_number($number) {
if (is_numeric($number)) {
return $number;
}
return FALSE;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment