echo htmlspecialchars(http_build_query($data));
// Hasil: foo=bar&amp;baz=boom&amp;cow=milk&amp;php=hypertext+processor