+1 vote
by
Hello! I am interested in a question, let's say I have a line //test can be and ///test or //test/test / //test//test , how do I replace the n number of characters "/" with only 1 /test/test ? I just don't know how to make it optimized.
by
FanatPHP , today I found it in the address bar of his site, which broke the engine. (Just in case :D). Tk used $_SERVER['REQUEST_URI']
by
Where do all these sticks come from?

1 Answer

0 votes
by
 
Best answer
preg_replace('/\/+/', '/', $str)
...