i have created one function to upload image using web services.
$image_url=time().$img_name;
$path=$_SERVER['DOCUMENT_ROOT'].'/img';
$image_url_src=$path."/".$image_url;
$current = file_get_contents($image_url_src);
$current = base64_decode($img_url);
$res=file_put_contents($image_url_src,$current);
chmod($image_url_src, 0777);
if($res===true)
{
$folder_img_url1="http://www.example.com/img/".$image_url;
$auth_error=array("img_url" => $folder_img_url1);
return json_encode($auth_error);
}
Everything is working properly.. only problem is why not returning value after this line of code file_put_contents($image_url_src,$current);
if i return any value before file_put_contents function than it works but after calling file_put_contents()
after that not return works so why?
ANY HELP WOULD BE APPRECIATED
</div>