when i try to process a file with command line :
cat texte.txt|php index.php
i got this weird stack:
C:\wamp\www\Fraud Prevention>cat texte.txt|php index.php
PHP Notice: Undefined offset: 1 in C:\wamp\www\Fraud Prevention\index.php on li
ne 92
PHP Stack trace:
PHP 1. {main}() C:\wamp\www\Fraud Prevention\index.php:0
Notice: Undefined offset: 1 in C:\wamp\www\Fraud Prevention\index.php on line 92
Call Stack:
0.0005 330608 1. {main}() C:\wamp\www\Fraud Prevention\index.php:0
PHP Notice: Undefined offset: 2 in C:\wamp\www\Fraud Prevention\index.php on li
ne 94
PHP Stack trace:
PHP 1. {main}() C:\wamp\www\Fraud Prevention\index.php:0
Notice: Undefined offset: 2 in C:\wamp\www\Fraud Prevention\index.php on line 94
Call Stack:
0.0005 330608 1. {main}() C:\wamp\www\Fraud Prevention\index.php:0
PHP Notice: Undefined offset: 3 in C:\wamp\www\Fraud Prevention\index.php on li
ne 96
PHP Stack trace:
PHP 1. {main}() C:\wamp\www\Fraud Prevention\index.php:0
Notice: Undefined offset: 3 in C:\wamp\www\Fraud Prevention\index.php on line 96
Call Stack:
0.0005 330608 1. {main}() C:\wamp\www\Fraud Prevention\index.php:0
PHP Notice: Undefined offset: 4 in C:\wamp\www\Fraud Prevention\index.php on li
ne 98
PHP Stack trace:
PHP 1. {main}() C:\wamp\www\Fraud Prevention\index.php:0
Notice: Undefined offset: 4 in C:\wamp\www\Fraud Prevention\index.php on line 98
Call Stack:
0.0005 330608 1. {main}() C:\wamp\www\Fraud Prevention\index.php:0
PHP Notice: Undefined offset: 5 in C:\wamp\www\Fraud Prevention\index.php on li
ne 100
PHP Stack trace:
PHP 1. {main}() C:\wamp\www\Fraud Prevention\index.php:0
Notice: Undefined offset: 5 in C:\wamp\www\Fraud Prevention\index.php on line 10
0
Call Stack:
0.0005 330608 1. {main}() C:\wamp\www\Fraud Prevention\index.php:0
PHP Notice: Undefined offset: 6 in C:\wamp\www\Fraud Prevention\index.php on li
ne 102
PHP Stack trace:
PHP 1. {main}() C:\wamp\www\Fraud Prevention\index.php:0
Notice: Undefined offset: 6 in C:\wamp\www\Fraud Prevention\index.php on line 10
2
Call Stack:
0.0005 330608 1. {main}() C:\wamp\www\Fraud Prevention\index.php:0
PHP Notice: Undefined offset: 7 in C:\wamp\www\Fraud Prevention\index.php on li
ne 104
PHP Stack trace:
PHP 1. {main}() C:\wamp\www\Fraud Prevention\index.php:0
Notice: Undefined offset: 7 in C:\wamp\www\Fraud Prevention\index.php on line 10
4
Call Stack:
0.0005 330608 1. {main}() C:\wamp\www\Fraud Prevention\index.php:0
PHP Notice: Undefined offset: 1 in C:\wamp\www\Fraud Prevention\index.php on li
ne 92
PHP Stack trace:
PHP 1. {main}() C:\wamp\www\Fraud Prevention\index.php:0
Notice: Undefined offset: 1 in C:\wamp\www\Fraud Prevention\index.php on line 92
Call Stack:
0.0005 330608 1. {main}() C:\wamp\www\Fraud Prevention\index.php:0
PHP Notice: Undefined offset: 2 in C:\wamp\www\Fraud Prevention\index.php on li
ne 94
PHP Stack trace:
PHP 1. {main}() C:\wamp\www\Fraud Prevention\index.php:0
Notice: Undefined offset: 2 in C:\wamp\www\Fraud Prevention\index.php on line 94
Call Stack:
0.0005 330608 1. {main}() C:\wamp\www\Fraud Prevention\index.php:0
PHP Notice: Undefined offset: 3 in C:\wamp\www\Fraud Prevention\index.php on li
ne 96
PHP Stack trace:
PHP 1. {main}() C:\wamp\www\Fraud Prevention\index.php:0
Notice: Undefined offset: 3 in C:\wamp\www\Fraud Prevention\index.php on line 96
Call Stack:
0.0005 330608 1. {main}() C:\wamp\www\Fraud Prevention\index.php:0
PHP Notice: Undefined offset: 4 in C:\wamp\www\Fraud Prevention\index.php on li
ne 98
PHP Stack trace:
PHP 1. {main}() C:\wamp\www\Fraud Prevention\index.php:0
Notice: Undefined offset: 4 in C:\wamp\www\Fraud Prevention\index.php on line 98
Call Stack:
0.0005 330608 1. {main}() C:\wamp\www\Fraud Prevention\index.php:0
PHP Notice: Undefined offset: 5 in C:\wamp\www\Fraud Prevention\index.php on li
ne 100
PHP Stack trace:
PHP 1. {main}() C:\wamp\www\Fraud Prevention\index.php:0
Notice: Undefined offset: 5 in C:\wamp\www\Fraud Prevention\index.php on line 10
0
Call Stack:
0.0005 330608 1. {main}() C:\wamp\www\Fraud Prevention\index.php:0
PHP Notice: Undefined offset: 6 in C:\wamp\www\Fraud Prevention\index.php on li
ne 102
PHP Stack trace:
PHP 1. {main}() C:\wamp\www\Fraud Prevention\index.php:0
Notice: Undefined offset: 6 in C:\wamp\www\Fraud Prevention\index.php on line 10
2
Call Stack:
0.0005 330608 1. {main}() C:\wamp\www\Fraud Prevention\index.php:0
PHP Notice: Undefined offset: 7 in C:\wamp\www\Fraud Prevention\index.php on li
ne 104
PHP Stack trace:
PHP 1. {main}() C:\wamp\www\Fraud Prevention\index.php:0
Notice: Undefined offset: 7 in C:\wamp\www\Fraud Prevention\index.php on line 10
4
Call Stack:
0.0005 330608 1. {main}() C:\wamp\www\Fraud Prevention\index.php:0
PHP Notice: Undefined offset: 1 in C:\wamp\www\Fraud Prevention\index.php on li
ne 92
PHP Stack trace:
PHP 1. {main}() C:\wamp\www\Fraud Prevention\index.php:0
Notice: Undefined offset: 1 in C:\wamp\www\Fraud Prevention\index.php on line 92
Call Stack:
0.0005 330608 1. {main}() C:\wamp\www\Fraud Prevention\index.php:0
PHP Notice: Undefined offset: 2 in C:\wamp\www\Fraud Prevention\index.php on li
ne 94
PHP Stack trace:
PHP 1. {main}() C:\wamp\www\Fraud Prevention\index.php:0
Notice: Undefined offset: 2 in C:\wamp\www\Fraud Prevention\index.php on line 94
Call Stack:
0.0005 330608 1. {main}() C:\wamp\www\Fraud Prevention\index.php:0
PHP Notice: Undefined offset: 3 in C:\wamp\www\Fraud Prevention\index.php on li
ne 96
PHP Stack trace:
PHP 1. {main}() C:\wamp\www\Fraud Prevention\index.php:0
Notice: Undefined offset: 3 in C:\wamp\www\Fraud Prevention\index.php on line 96
Call Stack:
0.0005 330608 1. {main}() C:\wamp\www\Fraud Prevention\index.php:0
PHP Notice: Undefined offset: 4 in C:\wamp\www\Fraud Prevention\index.php on li
ne 98
PHP Stack trace:
PHP 1. {main}() C:\wamp\www\Fraud Prevention\index.php:0
Notice: Undefined offset: 4 in C:\wamp\www\Fraud Prevention\index.php on line 98
Call Stack:
0.0005 330608 1. {main}() C:\wamp\www\Fraud Prevention\index.php:0
PHP Notice: Undefined offset: 5 in C:\wamp\www\Fraud Prevention\index.php on li
ne 100
PHP Stack trace:
PHP 1. {main}() C:\wamp\www\Fraud Prevention\index.php:0
Notice: Undefined offset: 5 in C:\wamp\www\Fraud Prevention\index.php on line 10
0
Call Stack:
0.0005 330608 1. {main}() C:\wamp\www\Fraud Prevention\index.php:0
PHP Notice: Undefined offset: 6 in C:\wamp\www\Fraud Prevention\index.php on li
ne 102
PHP Stack trace:
PHP 1. {main}() C:\wamp\www\Fraud Prevention\index.php:0
Notice: Undefined offset: 6 in C:\wamp\www\Fraud Prevention\index.php on line 10
2
Call Stack:
0.0005 330608 1. {main}() C:\wamp\www\Fraud Prevention\index.php:0
PHP Notice: Undefined offset: 7 in C:\wamp\www\Fraud Prevention\index.php on li
ne 104
PHP Stack trace:
PHP 1. {main}() C:\wamp\www\Fraud Prevention\index.php:0
Notice: Undefined offset: 7 in C:\wamp\www\Fraud Prevention\index.php on line 10
4
Call Stack:
0.0005 330608 1. {main}() C:\wamp\www\Fraud Prevention\index.php:0
EDIT:
here is my code between the 92 and 104 line:
$handle = fopen ("php://stdin","r");
$N = $title = fgets($handle, 1024);
while(!feof($handle))
{
if (!$order = fgets($handle)) continue;
$all_orders[] = explode(',', $order);
}
foreach ($all_orders as &$order){
$order["Order id"]=$order[0];
unset($order[0]);
$order["Deal id"]=$order[1];
unset($order[1]);
$order["Email address"]=$order[2];
unset($order[2]);
$order["Street address"]=$order[3];
unset($order[3]);
$order["City"]=$order[4];
unset($order[4]);
$order["State"]=$order[5];
unset($order[5]);
$order["Zip Code"]=$order[6];
unset($order[6]);
$order["Credit Card"]=$order[7];
unset($order[7]);
}
print_r($all_orders);
trim()off thefgets()call - I'm guessing you've got some of those empty items that you were getting a few hours ago...var_dump($all_orders)to confirm ;-)