我的功能是
// helper function for removing escaped characters
// from VARCHAR columns before converting table to JSON
function removeEscapes ( &$table )
{
http://stackoverflow.com/questions/12026609/wordpress-how-to-unescape-the-results-when-using-wpdb-get-results
foreach( $table as &$thisrow)
foreach( $thisrow as &$thiscol)
if ( is_string( $thiscol) ) $thiscol= stripslashes( $thiscol );
}
我称之为
<?php
ini_set('display_errors', 'On');
error_reporting(-1);
global $wpdb;
$wholeTeam = removeEscapes($wpdb->get_results("SELECT id,name,title,bio,picurl FROM mems"));
?>
<script type="text/javascript">
var team = <?php echo json_encode($wholeTeam); ?>;
</script>
为什么我
严格标准:只应通过引用传递变量
作为警告/错误?