Output array without single quotes this post is finally edited by kay89757sc from 2014-03-1503: 06: 33 database connection & nbsp; $ rs & nbsp; mysql_query (select & nbsp; id, degree, min, max, prize, v & nbsp; from & nbsp; magic_c output array without single quotation marks
This post was last edited by kay89757sc at 03:06:33
// Database connection
$ Rs = mysql_query ("select id, degree, min, max, prize, v from magic_config ");
While ($ r = mysql_fetch_assoc ($ rs )){
$ Prize_arr [] = $ r ;}
How can I leave the number obtained by degree in the output array with no single quotation marks?
$ Prize_arr = array (
Array ('id' => '1', 'degree' => 97, 'min' => '1', 'Max '=> '5 ', 'prize' => 'Don't give up', 'V' => '1 '),
Array ('id' => '2', 'degree' => 98, 'min' => '7', 'Max '=> '35 ', 'prize' => 'Don't be discouraged ', 'V' => '1 '),);
Only 97-98 is not a single quotation mark.
------ Solution --------------------
$ Prize_arr = array (
Array ('id' => '1', 'degree' => 97, 'min' => '1', 'Max '=> '5 ', 'prize' => 'Don't give up', 'V' => '1 '),
Array ('id' => '2', 'degree' => 98, 'min' => '7', 'Max '=> '35 ', 'prize' => 'Don't be discouraged ', 'V' => '1 '),);
Foreach ($ prize_arr as $ key => $ value ){
$ Prize_arr [$ key] ['Degree'] = (int) $ value ['Degree'];
}
Var_dump ($ prize_arr );
In fact, it is not necessary to convert php into weak-language characters and shaping.