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');