I\'m trying to replace all spaces with underscores and the following is not working:
$id = \"aa aa\"; echo $id; preg_replace(\'/\\s+/\', \'_\', $id); echo $i
We need to replace the space in the string "aa aa" with '_' (underscore). The \s+ is used to match multiple spaces. The output will be "aa_aa"