Element API - UrlHelper generates backwards slashes (regex) I am generating a url within Element API:

'profile' =&gt; UrlHelper::getUrl("directory/company/{$member-&gt;id}/{$urlslug}"),


which outputs:

http:\/\/craft.fira\/directory\/company\/1501\/abet-limited


What do I need to do to turn this into a real url without the backwards slashes "\"? As far as I understand this is a regular expression (regex) version of the url?

I will be using javascript to put this on the page, so it could either be fixed at source in the Element api php code, or alternatively when scraping through the JSON with Javascript.

Thanks in advance guys! :-)
The plugin probably uses PHP's json_encode to serialize the data and it automatically escapes quotation marks and backslashes to conform to the JSON format. Escaping the forward slashes of your URL wouldn't actually be necessary, but I just found this on StackOverflow which might give an idea why the function escapes them anyways:

https://stackoverflow.com/questions/1580647/json-why-are-forward-slashes-escaped

But you shouldn't really care about this behavior at all, because however you gonna consume that JSON string, the parser (e.g., jQuery.parseJSON()) should handle the unescaping for you.