Last character removed


Posted on 16th Feb 2014 07:03 pm by admin

I have created a string from an array. I have inserted commas from my form values. I am trying to remove the last comma from the string and can't seem to remove it. I have tried chop, rtrim, substr, substr_remove, trim and none of them seem to remove the last comma. $sql_meeting2 = "SELECT * FROM meeting WHERE location_id = '$location_id' ORDER BY day_id";
$result_meeting2 = mysql_query($sql_meeting2) or die(mysql_error());
while($data_meeting2 = mysql_fetch_array($result_meeting2)){
$day = $data_meeting2['day'];
$times = $data_meeting2['time'];
$open = $data_meeting2['open'];
$format = $data_meeting2['format'];
$format is the string I am trying to rtrim from.
This is my form codeCode: <td style="padding-left:15px;">
<input type="checkbox" name="format[]" value="Discussion,">Discussion<br />
<input type="checkbox" name="format[]" value="Basic Text Study,">Basic Text Study<br />
<input type="checkbox" name="format[]" value="It Works Study,">It Works Study<br />
<input type="checkbox" name="format[]" value="IP Study,">IP Study<br />
<input type="checkbox" name="format[]" value="Topic,">Topic<br />
<input type="checkbox" name="format[]" value="Candlelight,">Candlelight<br />
<input type="checkbox" name="format[]" value="Speaker,">Speaker<br />
<input type="checkbox" name="format[]" value="Birthday,">Birthday<br />
<input type="checkbox" name="format[]" value="Men,">Men<br />
<input type="checkbox" name="format[]" value="Women,">Women<br />
<input type="checkbox" name="format[]" value="Varies,">Varies<br />
<input type="checkbox" name="format[]" value="Other">Other
</td></tr>I have manipulated this form information with this:
$formats = $_POST['format'];
$format = implode(' ',$formats);
Can anyone help?

No comments posted yet

Your Answer:

Login to answer
287 Like 23 Dislike
Previous forums Next forums
Other forums

FROM_UNIXTIME($phpdate);
Hello,

I tried to use this :

$date = FROM_UNIXTIME($phpdate);

ANd I was t

Add_Months not Easy to Understand
Oracle is number 1, very fast and very easy. But....
OK, I think but have a problem, only 1 pro

PHP FTP Can't upload Big FIles
Anyone had any success using FTP to upload a file say 90m?

im using ftp_put and it returns fa

grouping within a foreach?
hello all,

I currently have a list of products spit out from my db via a foreach loop. Right

Parse error: parse error in C:wampwwwlogspagesmembers.php on line 16
I dont see the problem with this, I always get Parse error: parse error in C:wampwwwlogspagesme

get multiple rows
Hi I want to get multiple rows from a db

I am using this for the db query
Code: public

How to validate from 2 possible answers
Hi

I hope somebody can help me with what will probably be really simple, I'm pulling my hair

Multiple websites question.
Hi, does php have any functionality that enables a programmer to extract information from a website

Displaying returned XML in another PHP page
I have an online payment form that will return XML given if a payment is successful or declines. I

Problem!
I have another problem, when i run this code i get this error "Parse error: syntax error, unexp

Sign up to write
Sign up now if you have flare of writing..
Login   |   Register
Follow Us
Indyaspeak @ Facebook Indyaspeak @ Twitter Indyaspeak @ Pinterest RSS



Play Free Quiz and Win Cash