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
23
Other forums
Upload simple problem
Really confused!! I run once and it worked, but when i tried today...it didn't work
Which par
Career Change into SAP
Hai
I am sajesh ,did my diploma in Mechatronics i have a 4 years of experience in
Do not allow posting of whitespace
Currently the script below works if the user does not type a name/message, but if i create a whitesp
Scene graph using Direct3D?
There are several C++ scene graph based packages available for OpenGl, like say OSG,
http://w
FFmpeg Images 2 Video conversion problem ??
I got folder full of images , number of images = 600 , I want to make a video which plays one image
Php navigation
I have four buttons on a php page.
If i click a button it will redirect to different php pages.
Multidimensional array problems in $_POST
I'm having trouble with a three-dimensional $_POST array. It starts as a two-dimensional array on th
Unique Visitor Tracking
Hello. Currently, I run a voting site where voters are tracked by their IP address and can only vote
first few characters only
hi, does anyone know how to use PHP to take the first few words of a text and limit them? i have see
Curly Bracket Delimeters.
I'd always believed that the starting and ending delimeters in preg_ functions had to be the same ch