我不擅長於PHP,我想'連接'一個網址,我想在它的末尾添加一個毫秒的時間,所以這個網址是唯一的。連接名稱毫秒時間
完整的URL是這樣的:http://www.justedhak.comlu.com/images/uploaded_images1.jpg
我想毫秒的時間,每次添加到uploaded_images1
慾望的結果是這樣
...images/uploaded_images3214100.jpg
...images/uploaded_images3321490.jpg
...images/uploaded_images5216100.jpg
...images/uploaded_images6328490.jpg
我想我要補充輪()到$ imagename?這是我的代碼
$con = mysqli_connect($host,$uname,$pwd,$db);
$image=$_POST['image'];
$imagename="uploaded_images.jpg";
$imageurl="http://justedhak.comlu.com/images/."$imagename"";
$binary=base64_decode($image);
header('Content-Type: bitmap; charset=utf-8');
$file = fopen($imagename, 'wb');
fwrite($file, $binary);
fclose($file);
$sql = "insert into image (description,categorie,path) values ('$categorie','$description','$imageurl')";
你需要做一個獨特的名字,這就是它替換該行
? @Moudiz –
也許可以幫助你:http://stackoverflow.com/questions/17909871/getting-date-format-m-d-y-his-u-from-milliseconds –
@SubinThomas是唯一的名稱添加到網址。所以url上傳圖片是獨一無二的 – Moudiz