I'm creating a simple database restore script, but I ran into a bump in the road.
Database dump files are created with the script as well, and have the following filename format: datestamp-dbname.sql
With the restore script, I need to remove the datestamp, the hyphen and the .sql, to just leave the dbname.
I currently have this, which removes the first part, but I need to remove the .sql as well.
$getfilename = $_GET['filename'];
$dbname = explode("-", $getfilename[2]);
Thanks.