lundi 20 avril 2015

js output in php code

From the dynamic html form, I get the following inputs in js manner in php code :

$sl   = $_POST['sl'];   // input: 12
$name = $_POST['name']; // input: Jhon
$code = $_POST['code']; // input: 456
$val  = $_POST['val'];  // input: 10023

for ($i = 0; $i < count($sl); $i++) {
    $email_body .= "SL_No: " . $sl[$i] . "\n". "Name: " . $name[$i] . "code: " . $code[$i] . " Value: " . $val[$i] . "\n\n";
}

The out put is:

SL_No: 12
Name: Jhon Code:456 Value: 10023

Whereas I need in the output following manner:

SL[12]; 
Name[Jhon][456]="10023";

Can anybody help ne in correcting the PHP code

Aucun commentaire:

Enregistrer un commentaire