Re: Re: json_encode() behavior and the browser

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> Sorry about the error:
> In this case, you must set IT via meta tag to avoid it.

Ok, let's try this using a different approach.  Consider the following
pseudo-code:

<?php
$result = mysql_query( 'SELECT name, date FROM table WHERE field = "value"' );
$array = array();
while( $row = mysql_fetch_assoc( $result ))
{
  $array[] = $row;
}

$string = json_encode( $array );
?>

Why does the charset of the browser matter one whit to the value of
either $row['name'] or $row['date'] such that it would break
json_encode() in one case and not the other.  Is it that PHP is taking
the string which is returned as part of the result set and encoding it
to match the charset passed in from the browser?

thnx,
Christoph

* Disclaimer : the actual code (and data repository) I am using is
slightly different from the above but is similar enough so that it's a
valid representation

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux