I have the following URL: http://test.com/client/!MG2s-/
I want to be able to grab the slug and use it further down in my code
With the following code:
the output is
Even if the url is http://test.com/client/%21MG2s%2D/ the result is still the same. The slug is generated from a third party app, so the hyphen is required. I understand that dashes are used to sanitize titles, but I need to find a way to display the hyphen.
I have also tried with no success:
$str = str_replace('-', '%2D', $page_slug);
Is there any way that the hyphen can be displayed?
Read more here: Encode the url including hyphen in php