I have files on my server example 25295.txt, 24565.txt on my server where file name is the user id and the content of the file is like
[{"name":"+91 88264 73159","mobile":"+918826473159"},
{"name":"+91 99971 17220","mobile":"+919997117220"}]
My table structure is like this:
I want to run a cron job to insert each name and mobile with user_id (name of the text file is user id) in different rows from multiple files. There are around 800 records for the same in each file and also trim the mobile with:
$mobile=str_replace('+','0',$data['mobile']);
$mobile=str_replace(' ','',$mobile);
$mobile=substr($mobile, -10);
How to do the same and after the upload I want to delete the text file from the server.
