Replacing backslashes in php

by barkkathulla 2013-09-04 19:32:37


While using preg_replace some character s (like ,:,/....)shows missing end of delimiter error..To avoid it
\ can be replaced by \\ and also choose the given method...
Here get_tags variable denotes given string.

$custom_characters = array("/","\\", "[", "]", "{", "}",":");
$get_tags = str_replace($custom_characters, "",$get_tags);

while using backslash character problem arises like unexpected end delimiter...to avoid this problem,use this character as given above method

869
like
0
dislike
0
mail
flag

You must LOGIN to add comments