- str_replace: documentation ( source)
- html_entity_decode: documentation ( source)
- preg_replace: documentation ( source)
- ord: documentation ( source)
<?php
$string = html_entity_decode(" ");
print "The Problem: \n\n";
print ORD($string[0]);
print "\n";
print ORD($string[1]);
print "\n\n";
$string1 = str_replace("\u{c2a0}", "", $string);
$string2 = preg_replace('/^(\\s|\\xC2\\xA0)+|(\\s|\\xC2\\xA0)+$/', '', $string);
print "Mark Baker's Solution |" . $string1 . "|\n";
print "Codesmith's Solution |" . $string2 . "|\n";