This is a snippet from an Instagram JSON:
"images":{
"standard_resolution":
{ "url":"http:\/\/scontent-a.cdninstagram.com\/hphotos-xfa1\/t51.2885-15\/10593467_370803786404217_1595289732_n.jpg","width":640,"height":640}
}
I'd like to strip the protocol from ['images']['standard_resolution']['url']
. I tried with:
.parse_url($value['images']['standard_resolution']['url'], PHP_URL_HOST) . parse_url($value['images']['standard_resolution']['url'], PHP_URL_PATH).
But does nothing! I think it has to do with the /
escaping done in JSON (http:\/\/
). Because if I try
.parse_url("http://www.google.com", PHP_URL_HOST) . parse_url("http://www.google.com", PHP_URL_PATH).
.. it just works fine. I'd like to keep things easy.. and don't use regex. parse_url
would be perfect.