PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
for ( $counter = 1; $counter <= 5; $counter += 1)
{
if (!empty($_POST["rcpt".$counter])){$rcpt[$counter] = $_POST["rcpt".$counter];}
}
What I want to do is create automatically in a loop a load of variables if the post data exists - it's likely to be for 1-500 or more, but just trying 1-5 while I see if it'll work...
Set Search Time - A google chrome extension. When you search only results from the past year (or set time period) are displayed. Helps tremendously when using new technologies to avoid outdated results.
I think the array_filter could work for me, but unfortunately it is coming from a form but not php - it's an xml/xsl form which also does its own loop to add the number to the end of rcpt... Maybe the php needs to go and take stuff from the xml rather than using xsl to submit the data to the php? Other than this I've posted about (to prevent having to write 500 lines, and possibly making the php slow in the process?) everything else is working ok for me.
EDIT: "unfortunately it is coming from a form but not php" Just realised I may have been being dumb here?
Someone once told me that if it ends in numbers, it should be in an array. Even if it is coming from XML, SimpleXML could easily parse each node into an array.
But anyways, if you want to go your route, you'll need to use variable variables.
Set Search Time - A google chrome extension. When you search only results from the past year (or set time period) are displayed. Helps tremendously when using new technologies to avoid outdated results.