I'll explain a couple of differences between echo
, var_dump
and array
's.
Example echo's
$test = 'Hello, I am a test';
$second_test = 'Hi! I am a second test';
echo $test; // displays: Hello, I am a test
echo $second_test; // displays: Hi! I am a second test
echo $test . ' --- ' . $second_test; // displays: Hello, I am a test --- Hi! I am a second test
Echo's are being used to display a single item.
Documentation:
http://php.net/manual/en/function.echo.php
Examples var_dump's and array's
$test = 'Hello, I am a string';
$second_test = [
'one' => 'Wassup', // outcome: Wassup
'two' => $test, // outcome: Hello, I am a string
'three' => (1 + 2) // outcome: 3
];
$third_test = [
$fourth_test = [
'sup' => $second_test['two'], // outcome: Hello I am a string
],
];
echo '<pre>';
var_dump($test);
echo '</pre>';
//displays:
//string(20) "Hello, I am a string"
echo '<pre>';
var_dump($second_test);
echo '</pre>';
// displays:
//array(3) {
// ["one"]=>
// string(6) "Wassup"
// ["two"]=>
// string(20) "Hello, I am a string"
// ["three"]=>
// int(3)
//}
echo '<pre>';
var_dump($third_test);
echo '</pre>';
// displays:
//array(1) {
// [0]=>
// array(1) {
// ["sup"]=>
// string(20) "Hello, I am a string"
// }
//}
Documentation:
http://php.net/manual/en/function.var-dump.php
So related to what you need
Please use this code to see what the outcome is:
echo '<pre>';
var_dump($_POST['files']);
echo '</pre>';
If the outcome is an array, you can look at the second example on how to display the results.
I hope this will give you an idea on how to handle your $_POST['files']
.
I will update my answer meanwhile.
Edit #1:
$downloaded_files = $_POST['files'];
echo($downloaded_files);
$start = $downloaded_files+2;
Change it to: (note: there are a couple of other ways to get the same result. But I would like to see what happens).
$downloaded_files = $_POST['files'];
$start = ($downloaded_files + 2);
You could also do a var_dump($_POST)
, to see how many and which items are inside $_POST
.
Edit #2:
Please use the following code:
echo '<pre>';
var_dump($_POST);
echo '</pre>';
I need to know what is inside your $_POST
.