- print_r: documentation ( source)
- json_encode: documentation ( source)
<?php
//echo $string = 'Automóvel';
//echo utf8_encode($string);
$products = array('horloges', 'media', 'gereedschap');
echo'<pre>';print_r($products);
// convert to a string
$string = json_encode($products);
echo $string; // ["horloges","media","gereedschap"]