String utility functions for PHP