{"id":1336,"date":"2016-05-13T09:10:56","date_gmt":"2016-05-13T12:10:56","guid":{"rendered":"http:\/\/www.franklinjr.com\/blog\/?p=1336"},"modified":"2016-05-13T09:10:56","modified_gmt":"2016-05-13T12:10:56","slug":"exemplo-para-pegar-valor-do-teclado-no-php","status":"publish","type":"post","link":"https:\/\/www.franklinjr.com\/blog\/index.php\/2016\/05\/13\/exemplo-para-pegar-valor-do-teclado-no-php\/","title":{"rendered":"Exemplo para pegar valor do teclado no PHP"},"content":{"rendered":"<p>\u00c9 poss\u00edvel\u00a0buscar um valor do teclado pelo PHP executado como cliente com o exemplo abaixo:<\/p>\n<pre lang=\"php\" line=\"1\">\r\n<?php\r\necho \"Tem certeza que quer fazer isso? Digite 'sim' para continuar: \";\r\n$handle = fopen (\"php:\/\/stdin\",\"r\");\r\n$line = fgets($handle);\r\nif(trim($line) != 'sim'){\r\n    echo \"SAINDO!\\n\";\r\n    exit;\r\n}\r\nfclose($handle);\r\necho \"\\n\"; \r\necho \"Ok, feito!\\n\"\r\n?>\r\n<\/pre>\n<p>Baseado no exemplo do link: <a href=\"http:\/\/stackoverflow.com\/questions\/15322371\/php-wait-for-input-from-command-line\" target=\"_blank\">http:\/\/stackoverflow.com\/questions\/15322371\/php-wait-for-input-from-command-line<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u00c9 poss\u00edvel\u00a0buscar um valor do teclado pelo PHP executado como cliente com o exemplo abaixo:<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[76],"tags":[560],"class_list":["post-1336","post","type-post","status-publish","format-standard","hentry","category-php","tag-php"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v28.0 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\r\n<title>Exemplo para pegar valor do teclado no PHP - Franklin Jr.<\/title>\r\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\r\n<link rel=\"canonical\" href=\"https:\/\/www.franklinjr.com\/blog\/index.php\/2016\/05\/13\/exemplo-para-pegar-valor-do-teclado-no-php\/\" \/>\r\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.franklinjr.com\\\/blog\\\/index.php\\\/2016\\\/05\\\/13\\\/exemplo-para-pegar-valor-do-teclado-no-php\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"In\u00edcio\",\"item\":\"https:\\\/\\\/www.franklinjr.com\\\/blog\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Exemplo para pegar valor do teclado no PHP\"}]}]}<\/script>\r\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Exemplo para pegar valor do teclado no PHP - Franklin Jr.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.franklinjr.com\/blog\/index.php\/2016\/05\/13\/exemplo-para-pegar-valor-do-teclado-no-php\/","schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"BreadcrumbList","@id":"https:\/\/www.franklinjr.com\/blog\/index.php\/2016\/05\/13\/exemplo-para-pegar-valor-do-teclado-no-php\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"In\u00edcio","item":"https:\/\/www.franklinjr.com\/blog\/"},{"@type":"ListItem","position":2,"name":"Exemplo para pegar valor do teclado no PHP"}]}]}},"_links":{"self":[{"href":"https:\/\/www.franklinjr.com\/blog\/index.php\/wp-json\/wp\/v2\/posts\/1336","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.franklinjr.com\/blog\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.franklinjr.com\/blog\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.franklinjr.com\/blog\/index.php\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.franklinjr.com\/blog\/index.php\/wp-json\/wp\/v2\/comments?post=1336"}],"version-history":[{"count":2,"href":"https:\/\/www.franklinjr.com\/blog\/index.php\/wp-json\/wp\/v2\/posts\/1336\/revisions"}],"predecessor-version":[{"id":1338,"href":"https:\/\/www.franklinjr.com\/blog\/index.php\/wp-json\/wp\/v2\/posts\/1336\/revisions\/1338"}],"wp:attachment":[{"href":"https:\/\/www.franklinjr.com\/blog\/index.php\/wp-json\/wp\/v2\/media?parent=1336"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.franklinjr.com\/blog\/index.php\/wp-json\/wp\/v2\/categories?post=1336"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.franklinjr.com\/blog\/index.php\/wp-json\/wp\/v2\/tags?post=1336"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}