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'];
Did you know?Explore Trending and Topic pages for more stories like this.
$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

Save User Inputs while javascript reloading!
hi..
i have written a PHP code in which i reload the page when user selects a value in dropdown..

Save data in input fields when they press "BACK BUTTON"
Hi, this is html form: And let's say they get a error "Please enter ur title must be more then

Typing math
I've added support for typesetting math using LaTeX on the forums.

Example:
Code: [Select]

Need help: how to catch acess of undefined class properties
Hello. I am learning OO with PHP and have hit a problem.
Some code runs as perfectly valid code,

selectbox+database connection retrive problem
Code: [Select]
<tr>
<th align="left" scope="c

FAGL_FC_TRANSLATION FAS52 New GL ECC 6.0
Hello,

The new program for Translating GL Balances (FAS 52) gives the option to use diffe

displaying email without attracting a ton of spam
Hello,

this is maybe the wrong place to ask.
How would you display an email address on a w

division gives infinity anser
int main()
{
int z=0;
int i=1/z;
cout<
}

It doesn't throw a

BAPI BBP_INB_DELIVERY_CREATE - material number missing in delivery
Hi Experts,

I was able to successfully create an Inbound delivery with reference to a PO

Adding to the next element in a multidimensional array
Hi, I'm trying to add a value to $node->field_spaces['nid'] where x is the next available spo

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