function abc($a,$b) { return substr($a,$b); } function xyz() { global $x; $x=abc($x,3); } $x="10amici"; $b=3; xyz();