How to deal with output array without single quotes

Source: Internet
Author: User
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.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.