Expand|Select|Wrap|Line Numbers
- mylist=apple,cherry,lemon,banana&mylist2=apple,cherry,lemon,banana
is there a way to add commas and once it gets to the last value to write to get php to check that its the last value and not add a comma in?
Expand|Select|Wrap|Line Numbers
- $file = "upload/$random_digit/gallery.txt";
- $imgHandle = fopen($file, 'w') or die("can't open file");
- $iv= 1;
- $lQ = ',';
- $stringData = "&imgLoc=";
- fwrite($imgHandle, $stringData);
- for($i=0;$i<$totalRecords;$i++)
- {
- $stringData = $returnedData[$i]["imageLoc"] .$lQ ;
- fwrite($imgHandle, $stringData);
- }
- fclose($imgHandle);