Miscellaneous utility functions for PHP.