0

My function is

// 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 );
}

and I am calling it like

<?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>

Why am I getting

Strict Standards: Only variables should be passed by reference

as a warning/error?

0 Answers0