implementation php::substr