my output [menu1,menu2,menu3] arraylist store in database i want remove[,] in php
<p>i can send arraylist android to php throug url . that arraylist can store in database also.but it include [ at start ]at end. i want to remove brakets first and last </p>

<pre><code>        here my code is given

         &lt;?php
         $arr=explode(',',preg_replace('/^.*\[(.*)\].*$/','$1',$_POST['menuname']));
         mysql_connect("localhost","root","mobixmysql");
         mysql_select_db("test");
         foreach($arr as $value){
         mysql_query("INSERT INTO test (menuname) VALUES ('" . 
         mysql_real_escape_string($value) . "')")or
         die('unable'.mysql_error());
         echo "inserted";
         }
         ?&gt;
</code></pre>

<p>my database stored [menu1 in first row in menuname column,menu2 in second column at last] in mysql database how to remove brakets first and last ..please tell me</p>
