function resim($url,$name){ //
$urlBilgisi = pathinfo($url);
$uzanti = strtolower($urlBilgisi['extension']);
$ism="./resim/1_".$name.".".$uzanti;
$ch = curl_init($url);
$fopen = fopen($ism,'w');
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_FILE, $fopen);
curl_exec($ch);
curl_close($ch);
fclose($fopen);
return $ism;
}bu işlem sonucunda dönen $ism; i aynı sayfada 2 yerde kullanmak istiyorum.
birinde echo resim(URL, isim); fonksiyonunu ekrana basarken çalıştırarak bastığımdan bir tanesini kurtarmış oluyoruz. 2. ekrana basma işleminde echo $ism yaparsam
Notice: Undefined variable: ism in D:\xampp\htdocs\1\controllers\search.php on line 114
hatasını alıyorum.nasıl bir yol izlemeliyim ?