I have a PHP post form that posts up to 4 variables. I need whatever variables are passed to be combined into one comma seperated string (eg variable1,variable2,variable3,variable4). This i can do with the code below.
Code: [Select]$combo = array($one, $two, $three, $four);
$list = implode(",", $combo);
my problem is that the form fields are optional by design so that the user doesn't always post all 4 variables. Sometimes they will post 1, sometimes they will post all 4. So if a user only selects two fields and submits the form i will end up with a string looking like:
variable1,variable2,,
when what i really want is (note the removal of the trailing commas at the end of the string):
variable1,variable2
Can anyone point me towards a possible solution for this?
parse error
Parse error: syntax error, unexpected '[', expecting ')' in /Users/admin/Sites/phptest/array.php on line 5 Code: <?phpfunction shippingPrice($zone,$weight){ $ground = array(2 => array
COde for a Cc
I'm not receiving $ft as a Cc. Why is that??$to = "$email";$headers = "From:" .$tf."\r\n";$headers .= "Cc: $tf\r\n";$subject = "SUBJECT"; $message =
RFQ Configuration - can you make PLANT field an optional field in ME42
Is there a way to make the plant field on an RFQ optional in change mode (ME42)?
array_count_values question?
ok i'm trying to create a top ten list from a database of listed favorite movies.the following code yields me the correct order and number of votes for each movie$compare = array_count_values
Detail Expenses Report by Cost Center
I would like to obtain a report out of SAP that shows a list of expenses by cost center that shows the vendor that the expense related to.
Sort a two dimensional array.
Hi. I've set up a two dimensional array that reads as follows:Code: $modifiedData = array( array($arrCollingwoodStart[0], $numCollingwoodForTotal, $numCollingwoodAgainstTotal,
SESSION question
I am building an application , a directory for auctions.For SEO i made a script which copies a php file to all the directories paths that it creates.I made it work and into all the php files into each
Help on query replacing the date
Hi Pals,
unexpected T_SL without a shift left token
Nothing too see here, I'm an idiot and resolved the problem.
Renaming array keys
The issue: renaming array keys inside a foreach loop.I'm trying to build a pie chart image with the Google Chart API using information from a database. (I'm going to change the type of data I talk