PHP how to split an array in variables -


hi need help! i've starting learn php week ago. have form post text field contact, need split array in variables put in email. code

$field  = $_post['input']; if ( isset( $field ) === true){  foreach ($field $key => $value) {      echo '<pre>' , print_r( $value ) , '</pre>'; //to list array      }      $to = $mail;     $sbj = "thanks register $site";     ..//some headers     mail($to,sbj,$headers)  } 

and form

<form action="upload.php" method="post">  <input type="text" name="input[]">  <input type="text" name="input[]">  <input type="text" name="input[]">  <input type="submit" value="invia"> </form> 

any suggestion retrive variables on array include on mail?

@john has given right procedure . can use procedure using array_push() function eg:

$field  = $_post['input']; $info =  array();  foreach ($field $key => $value) {  array_push($info,$value); }  // echo implode(",",$info); $to = $mail; $sbj = "thanks register $site"; $body = implode(",",$info); ..//some headers mail($to,sbj,$body,$headers) 

Comments

Popular posts from this blog

image - ClassNotFoundException when add a prebuilt apk into system.img in android -

I need to import mysql 5.1 to 5.5? -

Java, Hibernate, MySQL - store UTC date-time -