Stripping Characters from Strings with PHP
Posted by Michael on Sunday, Feb 22nd, 2009 |
Comments | code snippet, PHP |
Permalink
This is a simple example of stripping chararcters from a string using PHP.
See comments in code below for results...
<?
$string = "1234567890";
$string = substr($string, 6); //strips off 123456
echo $string; //7890
$string = "123456";
$string = substr($string, 0, 1); //get first character
echo $string; //1
?>