htmlspecialchars() function should be used for security reason to echo values from any variable.
But htmlspecialchars() doe's not work for arrays so following function would...
Following funcion can be used to force to download remote files via curl:
$file = 'https://googledrive.com/host/0B_3oJnpnNoF9UjlkVUwtWE5CY0U/city.jpg';
download($file);
function download($url) {
set_time_limit(0);
...