Search
 
SCRIPT & CODE EXAMPLE
 

PHP

php how to rename a file before saving it

$temp = explode(".", $_FILES["file"]["name"]);
$newfilename = round(microtime(true)) . '.' . end($temp);
move_uploaded_file($_FILES["file"]["tmp_name"], "../img/imageDirectory/" . $newfilename);
Comment

PREVIOUS NEXT
Code Example
Php :: php validate only numbers 
Php :: form submitting twice 
Php :: php artisan migrate not working 
Php :: How to add new column in table laravel 
Php :: php stmt prepare error 
Php :: How to copy all files from one folder to another in PHP? 
Php :: remove 1 day from date in php 
Php :: Convert Carbon Seconds Into Days Hours Minute 
Php :: wordpress get perma link 
Php :: how to convert string word to lowercase in php 
Php :: php remove empty values from array 
Php :: csv to array in php 
Php :: laravel append to model 
Php :: how to get previous month in php 
Php :: php rename files in directory 
Php :: inner join codeigniter 
Php :: laravel 8 check if null or empty 
Php :: get key of value array php 
Php :: laravel limit query pagination 
Php :: how to take last entry in database in laravel Method ONe 
Php :: add field to many to many relationship laravel 
Php :: Weronika Goretzki 
Php :: woocommerce get post terms product 
Php :: php cookie never expire 
Php :: update eloquent with increment laravel 
Php :: laravel collect where not 
Php :: laravel 8 date difference in days 
Php :: php mysql insert date time 
Php :: phpmyadmin first login 
Php :: page expire in laravel 
ADD CONTENT
Topic
Content
Source link
Name
2+1 =