{"id":265,"date":"2012-09-17T14:13:18","date_gmt":"2012-09-17T13:13:18","guid":{"rendered":"http:\/\/pjsmith.me.uk\/?p=265"},"modified":"2012-09-17T14:14:48","modified_gmt":"2012-09-17T13:14:48","slug":"convert-string-to-html-url-safe-version-htmlentities","status":"publish","type":"post","link":"https:\/\/pjsmith.me.uk\/index.php\/2012\/09\/convert-string-to-html-url-safe-version-htmlentities\/","title":{"rendered":"Convert string to HTML URL safe version (url encode)"},"content":{"rendered":"<p>This utility will convert a URL string into an HTML safe string safe for inclusion in a URL as a variable etc. Just enter the string in the box below, press the button and the answer will be shown. The php function &#8216;urlencode()&#8217; is used.<\/p>\n<form action=\"\" method=\"post\" name=\"form1\">String to convert<\/p>\n<p><textarea id=\"txt\" name=\"txt\" rows=\"5\" cols=\"45\"><\/textarea><\/p>\n<p><input id=\"Test it\" type=\"submit\" name=\"Test it\" value=\"Submit\" \/><\/p>\n<\/form>\n<p><?php \nif (isset($_POST['txt'])) :\n\n$time_start = microtime(true);\n$safestring = urlencode($_POST['txt']);\n$time_end = microtime(true);\n$time = $time_end - $time_start;\n?><\/p>\n<p><strong>The results of last conversion is as follows<\/strong><\/p>\n<p>The safe version of the string is<br \/>\n<textarea id=\"txt2\" name=\"txt2\" rows=\"5\" cols=\"45\"><?php echo htmlentities($safestring);endif;?> <\/textarea><\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>This utility will convert a URL string into an HTML safe string safe for inclusion in a URL as a variable etc. Just enter the string in the box below,&#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[5],"tags":[],"class_list":{"0":"post-265","1":"post","2":"type-post","3":"status-publish","4":"format-standard","6":"category-tech"},"jetpack_featured_media_url":"","jetpack-related-posts":[],"jetpack_sharing_enabled":true,"jetpack_likes_enabled":true,"_links":{"self":[{"href":"https:\/\/pjsmith.me.uk\/index.php\/wp-json\/wp\/v2\/posts\/265","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/pjsmith.me.uk\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/pjsmith.me.uk\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/pjsmith.me.uk\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/pjsmith.me.uk\/index.php\/wp-json\/wp\/v2\/comments?post=265"}],"version-history":[{"count":0,"href":"https:\/\/pjsmith.me.uk\/index.php\/wp-json\/wp\/v2\/posts\/265\/revisions"}],"wp:attachment":[{"href":"https:\/\/pjsmith.me.uk\/index.php\/wp-json\/wp\/v2\/media?parent=265"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/pjsmith.me.uk\/index.php\/wp-json\/wp\/v2\/categories?post=265"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/pjsmith.me.uk\/index.php\/wp-json\/wp\/v2\/tags?post=265"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}