How can I add a time stamp to a file name uploaded with $_File before the file extension

php

Solution

$path_parts = pathinfo($_FILES["p_image"]["name"]);
$image_path = $path_parts['filename'].'_'.time().'.'.$path_parts['extension']

Problem

I have the following code ``` $image_path = $_FILES["p_image"]["name"].time(); ``` it names the file `image02.jpg1335279888` but i want it to be named `image02_1335279888.jpg` How can I achieve that?

Original source