I have 3 variables I'm trying to explode on from AJAX. One is a concatenation.
I tried this first
$XFiles = explode(",".$fileName." && ".$fileID, $row['filename']); //Dosnt Work
$XFiles = explode(",".$fileName."&&".$fileID, $row['filename']); //Dosnt Work
$XFiles = explode(",".$fileName." &&".$fileID, $row['filename']); //Dosnt Work
$XFiles = explode(",".$fileName."&& ".$fileID, $row['filename']); // Works?
//Set $row to $filesBunch = $row['filename'];
Many instances of filename in filebunch
:
$fileID = $_POST['ID'];
$fileName = $_POST['fileName'];
I have 2 variables I'm trying to explode on BUT one needs concatenation.
The comparison between the 2 records must adhere to X format - img.jpg && 2
$newfileName = ",".$fileName."&&".$fileID;
$XFiles = explode($newfileName,$filesBunch);
echo $XFiles[0]; //Case whichever doesnt function
But, if I arrange the code with a white space after the second &&
it works? I'm not sure why? There are no current examples. I can't find and the data. I've found on whitespace markup says periods equal 1 whitespace AND the PHP code eliminates white spaces between double quotes. Please help, thank you.
$newfileName = ",".$fileName."&& ".$fileID;
$XFiles = explode($newfileName,$filesBunch);
echo $XFiles[0/1]; //Works?