I'm trying to get the name of the files after submitting the form:
add_action('gform_after_submission_5', function ($entry, $form) {
$file_url = $entry['5'];
$filename = basename($file_url);
}, 10, 2);
When giving a var_dump $file_url;
it returns this (I'm uploading only one file for now):
And giving a var_dump $filename;
returns this:
string (17) "stabbing313.jpg"] "
How do I make $ filename not get the quotation marks and bracket?
UPDATE
When you do this:
$foo = explode(",", $file_url[0]);
foreach ($foo as $teste) {
echo $teste.'<br>';
}
It even returns the URLs with the brackets:
["http: //winds.local/wp-content/uploads/2016/04/WOLVERINE-THE-X-MEN-11-AVX-Tie-In10.jpg" "http: //winds.local/wp-content/uploads/2016/04/stabbing324.jpg"]