Getting input and putting it into an array
Posted: Sun Dec 07, 2014 7:54 pm
Hi. I subscribe to a text messaging service. I am writing a php script to accept input from a field for a phone number. I would like to pass that to the next page and have it go into an array. So if I input the phone numbers separated by commas, it would send my messages one at a time.
Currently my input page looks like this...
Then in sendit.php I have...
What would I need to do to grab the input which could look like...
and make the $people array look like this...
Right now I am hard-coding the numbers when I need to send out bulk messages but I would rather do it via a input form page. Thanks!
Currently my input page looks like this...
Code: Select all
<form action="sendit.php" method="post" name="form1">
<input type="text" name="phone" value="" size="160">
<input type="submit" value="Submit" name="submit">
Code: Select all
$people = array(
"+19145551111",
);
Code: Select all
+19145551111,+19145551212,+19145551313,+19145551414Code: Select all
$people = array(
"+19145551111",
"+19145551212",
"+19145551313",
"+19145551414",
);Right now I am hard-coding the numbers when I need to send out bulk messages but I would rather do it via a input form page. Thanks!