encode_entities($s) would do
In reply to Re^4: Any security holes? by ikegami in thread Any security holes? by Limbomusic