{"id":130,"date":"2011-12-24T14:55:10","date_gmt":"2011-12-24T14:55:10","guid":{"rendered":"https:\/\/ibex.tech\/cloud\/?p=130"},"modified":"2022-02-17T07:14:05","modified_gmt":"2022-02-17T07:14:05","slug":"echo","status":"publish","type":"post","link":"https:\/\/ibex.tech\/cloud\/php\/echo\/echo","title":{"rendered":"Echo"},"content":{"rendered":"\n<pre class=\"wp-block-code\"><code>  echo \"Some Text&lt;br \/&gt;\";\n  echo $someVariable . \"&lt;br \/&gt;\";\n  echo \"His name is $name and his age is $age\";<\/code><\/pre>\n\n\n\n<h5 class=\"wp-block-heading\">Abbreviated way of inserting an echo in HTML<\/h5>\n\n\n\n<p>&#8220;&lt;?=&#8221; can be used in place of &#8220;&lt;?php echo&#8221;<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&lt;?=\"&lt;p&gt;Hello world&lt;\/p&gt;\";?&gt;\n&lt;?=$MyVaraibleA . \" \" . $MyVaraibleB;?&gt;\n\nIs the same as:\n&lt;?php echo \"&lt;p&gt;Hello world&lt;\/p&gt;\";?&gt;\n&lt;?php echo $MyVaraibleA . \" \" . $MyVaraibleB;?&gt;<\/code><\/pre>\n\n\n\n<p>Calling a function that can return an optional string within HTML<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>  &lt;?= MyFunction();?>&lt;\/p> \n\nAn example that tests a submitted form entry and returns a string that is blank or has an error message:\n  &lt;p class=\"error\" id=\"b-error\">&lt;?= DoSomething($_POST&#91;\"some-field\"]);?>&lt;\/p> <\/code><\/pre>\n\n\n\n<h4 class=\"wp-block-heading\">Multiple Lines<\/h4>\n\n\n\n<pre class=\"wp-block-code\"><code>echo &lt;&lt;&lt;END\n\tBlah blah\n\tblah blah blah\n\tblah\nEND;<\/code><\/pre>\n\n\n\n<p>Note the END marker must appear at the start of the line with no whitespace<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">Echo the contents of an array<\/h4>\n\n\n\n<pre class=\"wp-block-code\"><code>\tprint_r($my_array);\n\t\/\/or\n\tprint_r($my_array&#91;0]);<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Abbreviated way of inserting an echo in HTML &#8220;&lt;?=&#8221; can be used in place of &#8220;&lt;?php echo&#8221; Calling a function that can return an optional string within HTML Multiple Lines Note the END marker must appear at the start of the line with no whitespace Echo the contents of an array<\/p>\n","protected":false},"author":5,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[23],"tags":[],"class_list":["post-130","post","type-post","status-publish","format-standard","hentry","category-echo"],"_links":{"self":[{"href":"https:\/\/ibex.tech\/cloud\/wp-json\/wp\/v2\/posts\/130","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ibex.tech\/cloud\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ibex.tech\/cloud\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ibex.tech\/cloud\/wp-json\/wp\/v2\/users\/5"}],"replies":[{"embeddable":true,"href":"https:\/\/ibex.tech\/cloud\/wp-json\/wp\/v2\/comments?post=130"}],"version-history":[{"count":11,"href":"https:\/\/ibex.tech\/cloud\/wp-json\/wp\/v2\/posts\/130\/revisions"}],"predecessor-version":[{"id":4000,"href":"https:\/\/ibex.tech\/cloud\/wp-json\/wp\/v2\/posts\/130\/revisions\/4000"}],"wp:attachment":[{"href":"https:\/\/ibex.tech\/cloud\/wp-json\/wp\/v2\/media?parent=130"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ibex.tech\/cloud\/wp-json\/wp\/v2\/categories?post=130"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ibex.tech\/cloud\/wp-json\/wp\/v2\/tags?post=130"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}