taking the first few characters of a string
Posted: Wed Jan 10, 2007 7:37 am
Is it possible to take the first 4 characters of a surname, for example, and store them in a variable?
Im sure there's probably a built-in function that performs this task but im yet to find it and i hope someone here can help.
I guess it might look something like...
But maybe not.
Im sure there's probably a built-in function that performs this task but im yet to find it and i hope someone here can help.
I guess it might look something like...
Code: Select all
$surname = $_POST['surname'];
$short_surname = some_function($surname, '4');