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

Sub-domains & calling unique content
Hello,

Is there a way use something similar to the $_GET function for a sub-domain? I to be a

php ajax - two drop down list with a submit button
i have created a form with 2 drop-down list and a submit button. I would like to know how to pass th

want to add a break after a certain amount of characters
i was wondering how to add a break in a blog post after a certain amount of characters... any idea o

Data Function is Its Not working IN IE8
This is my first time to use formums. I hope i can get solution for this problem. view plaincopy to

strtotime issue
Hey all,

I'm playing around with some code, and basically the idea is:

Person changes

Calling a Procedure with IN & OUT Parameters
Hello,

I usually call my procedures using the following way

declare variable e

Help with usergroups? prolly really quick
So were coding our own forums for a game system we made an we have the users level setup but now I n

ASP.NET 2.0 - Enter Key - Default Submit Button
Hi,One of the most annoying things in developing web pages is handling the "Enter key" for form subm

Form help: Syntax & Logic
Hello again all,

I'm working on a form and ran into a wall (again) and can't seem to think th

ClientScript.RegisterClientScriptBlock Issue
This is what I haveview plaincopy to clipboardprint?Protected Sub posrback_Click(ByVal sender As Obj

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