Two pages compiled by the same editor eclipsephp Studio v1.2.2, Print_r output Why is the font size format inconsistent? Use ajax.php Normal, with Osg_aja

Source: Internet
Author: User
Tags urlencode
Two pages written by the same editor eclipsephp Studio v1.2.2, Print_r output Why is the font size format inconsistent? Use ajax.php Normal, with Osg_aja
Two pages written by the same editor eclipsephp Studio v1.2.2, Print_r output Why is the font size format inconsistent? Results result in three level provinces and cities linkage with ajax.php normal, with osg_ajax.php not normal
The code in ajax.php is as follows:
Header ("CONTENT-TYPE:TEXT/HTML;CHARSET=GBK");
$sql = "SELECT * from ' ecs_region ' WHERE ' parent_id ' = ' 1 ' ORDER by ' region_id ' ASC";
$list = $db->getall ($sql);
foreach ($list as $key = = $val) {
$list [$key] [' region_name '] = UrlEncode (iconv (' GBK ', ' utf-8 ', $val [' Region_name ']));
}
Print_r (Json_encode ($list));

The output results are as follows:
———————————————————————————————————————————————————————

———————————————————————————————————————————————————————



osg_ajax.php
The code is as follows:
$sql = "SELECT * from ' osg_region ' WHERE ' parent_id ' = ' 1 ' ORDER by ' region_id ' ASC";

$cursor = Exequery ($connection, $sql);

while ($rows =mysql_fetch_assoc ($cursor)) {
$arr []= $rows;
}

foreach ($arr as $key = $val)
{
$arr [$key] [' region_name '] = UrlEncode (iconv (' GBK ', ' utf-8 ', $val [' Region_name '])); //

}

Print_r (Json_encode ($arr));

——————————————————————————————————————————————————
The output results are as follows:


------Solution--------------------
Coding problems? BOM Header?
  • Related Article

    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.