public reduce_string ( $str ) : string | ||
$str | string string value to strip of comments and whitespace | |
return | string | string value stripped of comments and whitespace |
function reduce_string($str)
{
$str = preg_replace(array('#^\\s*//(.+)$#m', '#^\\s*/\\*(.+)\\*/#Us', '#/\\*(.+)\\*/\\s*$#Us'), '', $str);
// eliminate extraneous space
return trim($str);
}