$value) { $output .= ' ' . ($export_keys ? drupal_var_export($key) . ' => ' : '') . drupal_var_export($value, ' ', FALSE) . ",\n"; } $output .= ')'; } } elseif (is_bool($var)) { $output = $var ? 'TRUE' : 'FALSE'; } elseif (is_string($var)) { $line_safe_var = str_replace("\n", '\n', $var); if (strpos($var, "\n") !== FALSE || strpos($var, "'") !== FALSE) { // If the string contains a line break or a single quote, use the // double quote export mode. Encode backslash and double quotes and // transform some common control characters. $var = str_replace(array('\\', '"', "\n", "\r", "\t"), array('\\\\', '\"', '\n', '\r', '\t'), $var); $output = '"' . $var . '"'; } else { $output = "'" . $var . "'"; } } else { $output = var_export($var, TRUE); } if ($prefix) { $output = str_replace("\n", "\n$prefix", $output); } return $output; }