I have the following code
$image_path = $_FILES[\"p_image\"][\"name\"].time();
it names the file image02.jpg1335279888
bu
$path_parts = pathinfo($_FILES["p_image"]["name"]);
$image_path = $path_parts['filename'].'_'.time().'.'.$path_parts['extension']
You can check this one:
$file = $_FILES["p_image"]["name"];
$array = explode('.', $file);
$fileName=$array[0];
$fileExt=$array[1];
$newfile=$fileName."_".time().".".$fileExt;