{"id":3132,"date":"2019-06-13T00:00:41","date_gmt":"2019-06-13T00:00:41","guid":{"rendered":"http:\/\/softlect.in\/?p=3132"},"modified":"2019-06-13T00:36:58","modified_gmt":"2019-06-13T00:36:58","slug":"php-introduction","status":"publish","type":"post","link":"http:\/\/softlect.com\/index.php\/php-introduction\/","title":{"rendered":"PHP Introduction"},"content":{"rendered":"<p>PHP is a server side scripting language<\/p>\n<p>PHP script is written within &lt;?php\u00a0 \u2026.. ?&gt;<\/p>\n<p>When browser request a php document, the web server calls PHP processor, and the PHP processor interprets the script and sends the output of the script back to the web browser.<\/p>\n<p>&nbsp;<\/p>\n<p>The output of the PHP script is always an HTML. The client requesting the PHP script will never see the PHP code in the web browser.<\/p>\n<p>PHP scripts are saved using .php file extension<\/p>\n<p>&nbsp;<\/p>\n<p>PHP is a purely interpreted language, however recent developments of PHP performs some precompilation.<\/p>\n<p>&nbsp;<\/p>\n<p>PHP is case sensitive<\/p>\n<p>&nbsp;<\/p>\n<p>The syntax of PHP is very similar to JavaScript<\/p>\n<p>PHP statements are terminated with semicolon<\/p>\n<p>Braces are used for compound statements or body of the control statements and functions<\/p>\n<p>&nbsp;<\/p>\n<p>PHP uses dynamic typing<\/p>\n<p>Variables are not declared using type<\/p>\n<p>The type of the variable is set whenever the variable is assigned a value<\/p>\n<p>Variable in PHP begin with a dollar ($) character followed by variable name<\/p>\n<p>An unassigned variable has a value NULL and is known as unbound variable.<\/p>\n<p>&nbsp;<\/p>\n<p>If unassigned variables are used in an expression, then its value is coerced to 0 if the context is number and coerced to empty string if its context is a string<\/p>\n<p>To check whether a variable has a value, IsSet function is used. This function takes variable as an argument and returns true if the variable has a value and false if variable is unassigned.<\/p>\n<p>&nbsp;<\/p>\n<p>The type of the variable can be determined in two ways:<\/p>\n<ul>\n<li>Using gettype function:<\/li>\n<\/ul>\n<p>Takes variable as parameter and returns string containing type of the variable<\/p>\n<ul>\n<li>Use type testing functions: which takes variable as parameter and returns Boolean value.<\/li>\n<\/ul>\n<p>is_int(), is_integer(), is_long(), id_double(), is_float(), is_real(), is_bool() and is_string()<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>PHP allows comments in three different ways:<\/p>\n<p>Single line comments are specified using # or \/\/<\/p>\n<p>Multiline comments uses \/*\u00a0\u00a0\u00a0\u00a0 \u2026\u2026\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 *\/<\/p>\n","protected":false},"excerpt":{"rendered":"<p>PHP is a server side scripting language PHP script is written within &lt;?php\u00a0 \u2026.. ?&gt; When browser request a php document, the web server calls PHP processor, and the PHP&hellip; <\/p>\n","protected":false},"author":1,"featured_media":3169,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[82],"tags":[],"aioseo_notices":[],"amp_enabled":true,"_links":{"self":[{"href":"http:\/\/softlect.com\/index.php\/wp-json\/wp\/v2\/posts\/3132"}],"collection":[{"href":"http:\/\/softlect.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/softlect.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/softlect.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/softlect.com\/index.php\/wp-json\/wp\/v2\/comments?post=3132"}],"version-history":[{"count":2,"href":"http:\/\/softlect.com\/index.php\/wp-json\/wp\/v2\/posts\/3132\/revisions"}],"predecessor-version":[{"id":3158,"href":"http:\/\/softlect.com\/index.php\/wp-json\/wp\/v2\/posts\/3132\/revisions\/3158"}],"wp:featuredmedia":[{"embeddable":true,"href":"http:\/\/softlect.com\/index.php\/wp-json\/wp\/v2\/media\/3169"}],"wp:attachment":[{"href":"http:\/\/softlect.com\/index.php\/wp-json\/wp\/v2\/media?parent=3132"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/softlect.com\/index.php\/wp-json\/wp\/v2\/categories?post=3132"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/softlect.com\/index.php\/wp-json\/wp\/v2\/tags?post=3132"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}