I’ve mysql query in array in the below format,i’ve to remove the last and
Array ( [0] => date = '2012-02-22' and time ='08:49' and [1] => date = '2012-02-22' and time ='08:49' and )
I get this array as out put after putting into this function array_values();
I tried rtim and trim.
Thanks in-advance
Example:
Output:
ps: I did not write the inline or anonymous function as I do not know what version of PHP you are using. But, as example, you can write as of php 5.3
ps: I do not think that use of
trimorrtrimis good as it could remove the part of the query if the query is slightly different and has ‘and’ letters close to the end of the string.