<?php
function get_bcv_filename($get_the_path){
$path_name = pathinfo($get_the_path, PATHINFO_DIRNAME);
$base_name = pathinfo($get_the_path, PATHINFO_BASENAME);
$file_name = pathinfo($get_the_path, PATHINFO_FILENAME); // get and store the files name
$ext_name = pathinfo($get_the_path, PATHINFO_EXTENSION); // get and store the files original extension
echo $path_name;
//echo $base_name;
//$my_file_src = "http://ballerscv.media2/wp‑content/uploads/"; // get folder where converted files are now stored
$my_file_src = "http://ballerscv.media2/wp-content/uploads/";
$new_file_ext =".mp4"; // non mp4 files are being converted to mp4 so will have this extension.
// if the file is an mp4 file it won't be converted to mp4 so get the original file folder and extension
if ( strtolower($ext_name) == "m4v" || strtolower($ext_name) == "mp4"){
//$my_file_src = "http://ballerscv.com/wp‑content/uploads/formidable/"; // set folder to original file folder
$my_file_src = $path_name . "/" ;
$new_file_ext = "." . $ext_name; // set extension to original extension
}
$new_file = $my_file_src . $file_name . $new_file_ext;
return $new_file;
}
//echo pathinfo("http://ballerscv.com/wp‑content/uploads/formidable/everyfile.flv", PATHINFO_DIRNAME);
echo get_bcv_filename("http://ballerscv.media2/wp-content/uploads/formidable/everyfile.flv");
?>
Warning: PHP Startup: Unable to load dynamic library 'sodium.so' (tried: /usr/lib/php/8.3.5/modules/sodium.so (libsodium.so.23: cannot open shared object file: No such file or directory), /usr/lib/php/8.3.5/modules/sodium.so.so (/usr/lib/php/8.3.5/modules/sodium.so.so: cannot open shared object file: No such file or directory)) in Unknown on line 0
http://ballerscv.media2/wp-content/uploads/formidablehttp://ballerscv.media2/wp-content/uploads/everyfile.mp4
Notice: Use of undefined constant PATHINFO_FILENAME - assumed 'PATHINFO_FILENAME' in /in/qfPv7 on line 6
Warning: pathinfo() expects parameter 2 to be long, string given in /in/qfPv7 on line 6
http://ballerscv.media2/wp-content/uploads/formidablehttp://ballerscv.media2/wp-content/uploads/.mp4