Forum Moderators: coopster
$array = array ('field' => '<strong>testlink</strong>' );
$var = $array['field'];
echo $var.'<br>';
// $var contains array field value with html
$array = filter_var_array($array,FILTER_SANITIZE_STRING);
echo $var.'<br>';
// and now $var suddenly contains sanitized string
regular array manipulating works as expected (as I expected atleast)
$array2 = array ('field2' => 'value');
$var2 = $array2['field2'];
echo $var2.'<br>'; // 'value'
$array2['field2'] = 'test';
echo $var2; // still 'value' as it should be.
What am I missing?
What am I missing?
Nothing based on the PHP variable manual [php.net] and the fact it's not happening for me when I copy and paste your code... You're obviously not assigning by reference, which is how it appears your version of PHP is treating the assignment.
Have you checked your PHP version to make sure you're on 5.2 or higher? If so, I would think you should either contact your host and/or file a PHP bug report.