reduce_double_slashes()

reduce_double_slashes($str)

Parameters:
  • $str (string) – Input string
Returns:

A string with normalized slashes

Return type:

string

Converts double slashes in a string to a single slash, except those found in URL protocol prefixes (e.g. http://).

Example:

$string = "http://example.com//index.php";
echo reduce_double_slashes($string); // results in "http://example.com/index.php"
doc_CodeIgniter
2016-10-15 16:32:35
Comments
Leave a Comment

Please login to continue.