{"id":134,"date":"2022-08-09T18:00:28","date_gmt":"2022-08-09T18:00:28","guid":{"rendered":"https:\/\/www.devopstrainer.in\/blog\/?p=134"},"modified":"2022-08-09T18:00:28","modified_gmt":"2022-08-09T18:00:28","slug":"phphypertext-preprocessor","status":"publish","type":"post","link":"https:\/\/www.devopstrainer.in\/blog\/phphypertext-preprocessor\/","title":{"rendered":"PHP(Hypertext Preprocessor)"},"content":{"rendered":"\n<p class=\"has-medium-font-size\"><strong>NTRODUCTION<\/strong><\/p>\n\n\n\n<p class=\"has-black-color has-text-color\">PHP is Hypertext preprocessor It is a server-side scripting language that is used for web development. It can be easily embedded with HTML files. HTML codes can also be written in a PHP file. The PHP codes are executed on the server-side whereas HTML codes are directly executed on the browser.<\/p>\n\n\n\n<p class=\"has-medium-font-size\">Characteristics:<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>It is simple, easy and fast<\/li><li>Flexible<\/li><li>Open source<\/li><\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">1. COMMENTS<\/h2>\n\n\n\n<ul class=\"wp-block-list\"><li>A comment in PHP code is a line that is not executed as a part of the program.<\/li><li>It makes the code more readable<\/li><li>our code will neat and clean<\/li><\/ul>\n\n\n\n<p class=\"has-medium-font-size\">     <em>Types of Commond<\/em><\/p>\n\n\n\n<ol class=\"wp-block-list\"><li>Single line comment ( \/\/ )<\/li><li>Multiple lines comment( \/*           *\/ )<\/li><\/ol>\n\n\n\n<h2 class=\"wp-block-heading\">2. CONSTANTS<\/h2>\n\n\n\n<ul class=\"wp-block-list\"><li>constants are either identifiers or simple names that can be assigned any fixed values.<\/li><li>Constant Identifiers should be written in upper case\u00a0<\/li><li>constant is always case-Sensitive<\/li><li>\u00a0It always starts with a letter or underscores, letter, numbers or underscore<\/li><li>A constant name Must never start with a number<\/li><\/ul>\n\n\n\n<p>     SYNTAX:  define(<em>name, value, case_insensitive<\/em>)<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">3.ECHO \/ PRINT<\/h2>\n\n\n\n<ul class=\"wp-block-list\"><li>It has no return value and Print has return value of 1<\/li><li>It can take multiple PArameters and Print can take only one parameter<\/li><li>echo is faster than print<\/li><li>example: <\/li><\/ul>\n\n\n\n<div class=\"wp-block-group\"><div class=\"wp-block-group__inner-container is-layout-flow wp-block-group-is-layout-flow\">\n<p>         echo &#8221; hi everyone &#8220;<\/p>\n\n\n\n<p>         echo &#8221; hello world &#8220;<\/p>\n<\/div><\/div>\n\n\n\n<p>         <\/p>\n\n\n\n<h2 class=\"wp-block-heading\">4.DATA TYPE<\/h2>\n\n\n\n<ul class=\"wp-block-list\"><li>String: string is a sequence of characters.<\/li><li>Integer: it holds only whole numbers including positive and negative numbers, the default base is decimal (base 10).<\/li><li>Boolean: It is used for conditional testing and hold only two values TRUE and FALSE.<\/li><li>Array: It contain multiple values of same datatype in single variable<\/li><li>Object: Objects are defined as instances of user-defined classes that can hold both values and functions and information. objects are explicitly declared and created from the\u00a0<em>new\u00a0<\/em>keyword.<\/li><li>Null: These are special types of variables that can hold only one value  NULL and it is case sensitive, If a variable is created without a value or no value, it is automatically assigned a value of NULL<\/li><\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">5.SWITCH<\/h2>\n\n\n\n<ul class=\"wp-block-list\"><li>switch statement is used to execute one statement from multiple conditions<\/li><li>Each case can have a\u00a0<strong>break<\/strong>\u00a0statement, which is used to terminate the sequence of statement.<\/li><li>In switch statement, we can use number, character, string, functions<\/li><li>Syntax<\/li><\/ul>\n\n\n\n<pre class=\"wp-block-code\"><code> switch (<em>n<\/em>)\n {\n\u00a0\u00a0case\u00a0<em>label1:<\/em>\n\u00a0\u00a0<em>\u00a0\u00a0code to be executed if n=label1;<\/em>\n\u00a0 \u00a0\u00a0break;\n\u00a0 case\u00a0<em>label2:<\/em>\n\u00a0\u00a0<em>\u00a0\u00a0code to be executed if n=label2;<\/em>\n\u00a0\u00a0\u00a0 break;\n\u00a0 case\u00a0<em>label3:<\/em>\n\u00a0\u00a0<em>\u00a0\u00a0code to be executed if n=label3;<\/em>\n\u00a0\u00a0\u00a0 break;\n\u00a0 \u00a0 ...\n\u00a0\u00a0default:\n\u00a0\u00a0<em>\u00a0 code to be executed if n is different from all labels;<\/em>\n }<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\"><\/h2>\n","protected":false},"excerpt":{"rendered":"<p>NTRODUCTION PHP is Hypertext preprocessor It is a server-side scripting language that is used for web development. It can be easily embedded with HTML files. HTML codes can also be&hellip;<\/p>\n","protected":false},"author":3,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-134","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.0 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>PHP(Hypertext Preprocessor) - DevOps | SRE | DevSecOps<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.devopstrainer.in\/blog\/phphypertext-preprocessor\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"PHP(Hypertext Preprocessor) - DevOps | SRE | DevSecOps\" \/>\n<meta property=\"og:description\" content=\"NTRODUCTION PHP is Hypertext preprocessor It is a server-side scripting language that is used for web development. It can be easily embedded with HTML files. HTML codes can also be&hellip;\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.devopstrainer.in\/blog\/phphypertext-preprocessor\/\" \/>\n<meta property=\"og:site_name\" content=\"DevOps | SRE | DevSecOps\" \/>\n<meta property=\"article:published_time\" content=\"2022-08-09T18:00:28+00:00\" \/>\n<meta name=\"author\" content=\"shivam\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"shivam\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/www.devopstrainer.in\/blog\/phphypertext-preprocessor\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.devopstrainer.in\/blog\/phphypertext-preprocessor\/\"},\"author\":{\"name\":\"shivam\",\"@id\":\"https:\/\/www.devopstrainer.in\/blog\/#\/schema\/person\/0c8259479972d3d18994f88df3dc8d53\"},\"headline\":\"PHP(Hypertext Preprocessor)\",\"datePublished\":\"2022-08-09T18:00:28+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.devopstrainer.in\/blog\/phphypertext-preprocessor\/\"},\"wordCount\":353,\"commentCount\":0,\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/www.devopstrainer.in\/blog\/phphypertext-preprocessor\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.devopstrainer.in\/blog\/phphypertext-preprocessor\/\",\"url\":\"https:\/\/www.devopstrainer.in\/blog\/phphypertext-preprocessor\/\",\"name\":\"PHP(Hypertext Preprocessor) - DevOps | SRE | DevSecOps\",\"isPartOf\":{\"@id\":\"https:\/\/www.devopstrainer.in\/blog\/#website\"},\"datePublished\":\"2022-08-09T18:00:28+00:00\",\"author\":{\"@id\":\"https:\/\/www.devopstrainer.in\/blog\/#\/schema\/person\/0c8259479972d3d18994f88df3dc8d53\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.devopstrainer.in\/blog\/phphypertext-preprocessor\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.devopstrainer.in\/blog\/phphypertext-preprocessor\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.devopstrainer.in\/blog\/phphypertext-preprocessor\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.devopstrainer.in\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"PHP(Hypertext Preprocessor)\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.devopstrainer.in\/blog\/#website\",\"url\":\"https:\/\/www.devopstrainer.in\/blog\/\",\"name\":\"DevOps | SRE | DevSecOps\",\"description\":\"Automation means Cost, Quality, Time\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.devopstrainer.in\/blog\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.devopstrainer.in\/blog\/#\/schema\/person\/0c8259479972d3d18994f88df3dc8d53\",\"name\":\"shivam\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.devopstrainer.in\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/be603b13110d1423e9358d9f4b8901acd56c4239bca1b26b0225d217c2a2f1eb?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/be603b13110d1423e9358d9f4b8901acd56c4239bca1b26b0225d217c2a2f1eb?s=96&d=mm&r=g\",\"caption\":\"shivam\"},\"url\":\"https:\/\/www.devopstrainer.in\/blog\/author\/shivam\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"PHP(Hypertext Preprocessor) - DevOps | SRE | DevSecOps","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.devopstrainer.in\/blog\/phphypertext-preprocessor\/","og_locale":"en_US","og_type":"article","og_title":"PHP(Hypertext Preprocessor) - DevOps | SRE | DevSecOps","og_description":"NTRODUCTION PHP is Hypertext preprocessor It is a server-side scripting language that is used for web development. It can be easily embedded with HTML files. HTML codes can also be&hellip;","og_url":"https:\/\/www.devopstrainer.in\/blog\/phphypertext-preprocessor\/","og_site_name":"DevOps | SRE | DevSecOps","article_published_time":"2022-08-09T18:00:28+00:00","author":"shivam","twitter_card":"summary_large_image","twitter_misc":{"Written by":"shivam","Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.devopstrainer.in\/blog\/phphypertext-preprocessor\/#article","isPartOf":{"@id":"https:\/\/www.devopstrainer.in\/blog\/phphypertext-preprocessor\/"},"author":{"name":"shivam","@id":"https:\/\/www.devopstrainer.in\/blog\/#\/schema\/person\/0c8259479972d3d18994f88df3dc8d53"},"headline":"PHP(Hypertext Preprocessor)","datePublished":"2022-08-09T18:00:28+00:00","mainEntityOfPage":{"@id":"https:\/\/www.devopstrainer.in\/blog\/phphypertext-preprocessor\/"},"wordCount":353,"commentCount":0,"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.devopstrainer.in\/blog\/phphypertext-preprocessor\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.devopstrainer.in\/blog\/phphypertext-preprocessor\/","url":"https:\/\/www.devopstrainer.in\/blog\/phphypertext-preprocessor\/","name":"PHP(Hypertext Preprocessor) - DevOps | SRE | DevSecOps","isPartOf":{"@id":"https:\/\/www.devopstrainer.in\/blog\/#website"},"datePublished":"2022-08-09T18:00:28+00:00","author":{"@id":"https:\/\/www.devopstrainer.in\/blog\/#\/schema\/person\/0c8259479972d3d18994f88df3dc8d53"},"breadcrumb":{"@id":"https:\/\/www.devopstrainer.in\/blog\/phphypertext-preprocessor\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.devopstrainer.in\/blog\/phphypertext-preprocessor\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.devopstrainer.in\/blog\/phphypertext-preprocessor\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.devopstrainer.in\/blog\/"},{"@type":"ListItem","position":2,"name":"PHP(Hypertext Preprocessor)"}]},{"@type":"WebSite","@id":"https:\/\/www.devopstrainer.in\/blog\/#website","url":"https:\/\/www.devopstrainer.in\/blog\/","name":"DevOps | SRE | DevSecOps","description":"Automation means Cost, Quality, Time","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.devopstrainer.in\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/www.devopstrainer.in\/blog\/#\/schema\/person\/0c8259479972d3d18994f88df3dc8d53","name":"shivam","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.devopstrainer.in\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/be603b13110d1423e9358d9f4b8901acd56c4239bca1b26b0225d217c2a2f1eb?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/be603b13110d1423e9358d9f4b8901acd56c4239bca1b26b0225d217c2a2f1eb?s=96&d=mm&r=g","caption":"shivam"},"url":"https:\/\/www.devopstrainer.in\/blog\/author\/shivam\/"}]}},"_links":{"self":[{"href":"https:\/\/www.devopstrainer.in\/blog\/wp-json\/wp\/v2\/posts\/134","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.devopstrainer.in\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.devopstrainer.in\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.devopstrainer.in\/blog\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/www.devopstrainer.in\/blog\/wp-json\/wp\/v2\/comments?post=134"}],"version-history":[{"count":1,"href":"https:\/\/www.devopstrainer.in\/blog\/wp-json\/wp\/v2\/posts\/134\/revisions"}],"predecessor-version":[{"id":135,"href":"https:\/\/www.devopstrainer.in\/blog\/wp-json\/wp\/v2\/posts\/134\/revisions\/135"}],"wp:attachment":[{"href":"https:\/\/www.devopstrainer.in\/blog\/wp-json\/wp\/v2\/media?parent=134"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.devopstrainer.in\/blog\/wp-json\/wp\/v2\/categories?post=134"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.devopstrainer.in\/blog\/wp-json\/wp\/v2\/tags?post=134"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}