{"id":1308,"date":"2019-09-06T13:27:07","date_gmt":"2019-09-06T13:27:07","guid":{"rendered":"http:\/\/www.cotocus.com\/blog\/?p=1308"},"modified":"2023-09-10T08:19:21","modified_gmt":"2023-09-10T08:19:21","slug":"php-tutorial-for-beginners","status":"publish","type":"post","link":"https:\/\/www.cotocus.com\/blog\/php-tutorial-for-beginners\/","title":{"rendered":"PHP Tutorial for Beginners"},"content":{"rendered":"\n<p><strong><em>PHP FRONT TO BACK<\/em><\/strong>*<\/p>\n\n\n\n<p>**What is PHP?<br> :- PHP: Hypertext Preprocessor(Recursive Acronym)<br>     Server Side Programming\/Scripting Language<br>     Can be embedded directly within HTML (&lt;?php?&gt;)<br>     Files use a &#8220;.php&#8221; file extension<\/p>\n\n\n\n<p>** How Does PHP Work?<br>\n:-    Client makes a request<br>\n    Server runs PHP\/extensions<br>\n    Query database if needed<br>\n    Load other files if needed<br>\n    Result is sent back to client<\/p>\n\n\n\n<p>** Why Use PHP?<br> :-    Easy To Learn           Freedom<br>     Free &amp; Open Source      Frameworks<br>     Great support            Database Compatibility<br>     Cross Platform<\/p>\n\n\n\n<p>** What Can PHP do?<br>\n:-    Create dynamic page content     Interact with databases<br>\n    Interact with files on the server   Access control<br>\n    Collect &amp; process forms         Encrypt data<br>\n    Send\/ receive cookies           Almost anything else<\/p>\n\n\n\n<p>** What Can You Build With PHP?<br>\n:-    Basic Websites              Content Management Systems<br>\n    Blog Type Websites          Membership Websites<br>\n    Shopping Carts              Search Engines<br>\n    Social Networks             Backend APIs<\/p>\n\n\n\n<p>*** Install XAMPP Apache+MariaDB+PHP+Perl)(Latest version 7.1.1)<br>\n**    What is XAMPP?<br>\n:-     XAMPP is the most popular PHP development envirnment<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>Install XAMPP his after open It and start Apache and MySQL go browser and search &#8211; <br>\nhttps:\/\/loclalhost(here uses only htdocxs file your xampp file) <\/li><\/ul>\n\n\n\n<p>**    Variables<br>\n:-    Prefix $<br>\n    Start with a letter or an underscore<br>\n    only letter, numbers and underscores<br>\n    Case sensitive<\/p>\n\n\n\n<p>**    Data types<br>\n:-    String      (ex- 12, 0, -34 etc.)<br>\n    Integers    (ex- 25.2654, 2.12, 41.54 etc.)<br>\n    floats<br>\n    Booleans    (ex- true\/false)<br>\n    Arrays      (ex- multiple values in one single variable)<br>\n    Objects     (ex- hold programming objects)<br>\n    Null        (ex- hold only one value- NULL)<br>\n    Resource    (ex- special variable that hold references to resources external to PHP)<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>some Data type class\n<ul><li>$Output = &#8216;\u2026\u2026\u2026&#8217;;       (\u2026\u2026\u2026= You can use any word which you shown in desktop )<\/li><li>$num1 = 4;           ()<\/li><li>$num2 = 10;<\/li><li>$sum = #num1 + $num2;<\/li><li>$strings1 = &#8216;\u2026\u2026.&#8217;;<\/li><li>$strings2 = &#8216;\u2026\u2026.&#8217;;<\/li><li>$greeting = string1. &#8221;. $strings.&#8217;!&#8217;;<\/li><li>$greeting2 = &#8220;$string1 $string2&#8221;;<\/li><li>$string3 = &#8216;They\\&#8217;re Here&#8221;;<br>\n:- define(&#8216;GREETING&#8217;, &#8216;Hello Everyone&#8217;, true);<br>\n:- echo greeting;<\/li><\/ul><\/li><li>Array- basically variable that holds multiple values these are three types:-<br>\n1) Indexed<br>\n2) Associative<br>\n3) Multi-dimensional<\/li><\/ul>\n\n\n\n<p>**    1)Indexed<br>\n    some Indexed class<br>\n    &#8211; $people = array(&#8216;\u2026\u2026..&#8217;, &#8216;\u2026\u2026\u2026&#8217;, &#8216;\u2026\u2026..&#8217;; <br>\n    :- echo $people[3];<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\n- $ids = array (23, 55, 12);\n:- echo $ids&#x5B;2];\n\n- $cars= &#x5B;&#039;honda&#039;, &#039;Toyota&#039;, &#039;Ford&#039;;]\n:- $cars&#x5B;3]= &#039;Chevy&#039;;\n:- echo $ids&#x5B;3];\n<\/pre><\/div>\n\n\n<p>**    2) Associative arrays<br>\n    &#8211; $people = array(&#8216;\u2026\u2026.&#8217;=&gt; 35, &#8216;\u2026\u2026..&#8217;=&gt; 32, &#8216;\u2026\u2026..&#8217; =&gt; 27);<br>\n    :- $ids = [22 =&gt; &#8216;\u2026\u2026.&#8217; ];<br>\n    :- echo $ [&#8216;\u2026\u2026&#8217;];<\/p>\n\n\n\n<p>**    3) Multi Dimensional    <br>\n    $cars = array(<br>\n        array(&#8216;Honda&#8217;, 20, 10),<br>\n        array (&#8216;Toyota&#8217;, 30, 20),<br>\n        array (&#8216;Ford&#8217;, 23, 12),<br>\n        );<br>\n    echo $cars[1][2]<\/p>\n","protected":false},"excerpt":{"rendered":"<div class=\"mh-excerpt\"><p>PHP FRONT TO BACK* **What is PHP? :- PHP: Hypertext Preprocessor(Recursive Acronym) Server Side Programming\/Scripting Language Can be embedded directly within HTML (&lt;?php?&gt;) Files use <a class=\"mh-excerpt-more\" href=\"https:\/\/www.cotocus.com\/blog\/php-tutorial-for-beginners\/\" title=\"PHP Tutorial for Beginners\">[&#8230;]<\/a><\/p>\n<\/div>","protected":false},"author":14,"featured_media":1309,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[203],"tags":[94,208,518],"class_list":["post-1308","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-php","tag-beginners","tag-php","tag-tutorial"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.1.1 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>PHP Tutorial for Beginners - Cotocus<\/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.cotocus.com\/blog\/php-tutorial-for-beginners\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"PHP Tutorial for Beginners - Cotocus\" \/>\n<meta property=\"og:description\" content=\"PHP FRONT TO BACK* **What is PHP? :- PHP: Hypertext Preprocessor(Recursive Acronym) Server Side Programming\/Scripting Language Can be embedded directly within HTML (&lt;?php?&gt;) Files use [...]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.cotocus.com\/blog\/php-tutorial-for-beginners\/\" \/>\n<meta property=\"og:site_name\" content=\"Cotocus\" \/>\n<meta property=\"article:published_time\" content=\"2019-09-06T13:27:07+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2023-09-10T08:19:21+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.cotocus.com\/blog\/wp-content\/uploads\/2019\/09\/php.png\" \/>\n\t<meta property=\"og:image:width\" content=\"1406\" \/>\n\t<meta property=\"og:image:height\" content=\"752\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"ashwani Kumar\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"ashwani Kumar\" \/>\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.cotocus.com\/blog\/php-tutorial-for-beginners\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.cotocus.com\/blog\/php-tutorial-for-beginners\/\"},\"author\":{\"name\":\"ashwani Kumar\",\"@id\":\"https:\/\/www.cotocus.com\/blog\/#\/schema\/person\/301c405ff2c201a381ea126a3698a888\"},\"headline\":\"PHP Tutorial for Beginners\",\"datePublished\":\"2019-09-06T13:27:07+00:00\",\"dateModified\":\"2023-09-10T08:19:21+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.cotocus.com\/blog\/php-tutorial-for-beginners\/\"},\"wordCount\":342,\"commentCount\":0,\"image\":{\"@id\":\"https:\/\/www.cotocus.com\/blog\/php-tutorial-for-beginners\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.cotocus.com\/blog\/wp-content\/uploads\/2019\/09\/php.png\",\"keywords\":[\"Beginners\",\"php\",\"tutorial\"],\"articleSection\":[\"Php\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/www.cotocus.com\/blog\/php-tutorial-for-beginners\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.cotocus.com\/blog\/php-tutorial-for-beginners\/\",\"url\":\"https:\/\/www.cotocus.com\/blog\/php-tutorial-for-beginners\/\",\"name\":\"PHP Tutorial for Beginners - Cotocus\",\"isPartOf\":{\"@id\":\"https:\/\/www.cotocus.com\/blog\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.cotocus.com\/blog\/php-tutorial-for-beginners\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/www.cotocus.com\/blog\/php-tutorial-for-beginners\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.cotocus.com\/blog\/wp-content\/uploads\/2019\/09\/php.png\",\"datePublished\":\"2019-09-06T13:27:07+00:00\",\"dateModified\":\"2023-09-10T08:19:21+00:00\",\"author\":{\"@id\":\"https:\/\/www.cotocus.com\/blog\/#\/schema\/person\/301c405ff2c201a381ea126a3698a888\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.cotocus.com\/blog\/php-tutorial-for-beginners\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.cotocus.com\/blog\/php-tutorial-for-beginners\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.cotocus.com\/blog\/php-tutorial-for-beginners\/#primaryimage\",\"url\":\"https:\/\/www.cotocus.com\/blog\/wp-content\/uploads\/2019\/09\/php.png\",\"contentUrl\":\"https:\/\/www.cotocus.com\/blog\/wp-content\/uploads\/2019\/09\/php.png\",\"width\":1406,\"height\":752},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.cotocus.com\/blog\/php-tutorial-for-beginners\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.cotocus.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"PHP Tutorial for Beginners\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.cotocus.com\/blog\/#website\",\"url\":\"https:\/\/www.cotocus.com\/blog\/\",\"name\":\"Cotocus\",\"description\":\"Shaping Tomorrow\u2019s Tech Today\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.cotocus.com\/blog\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.cotocus.com\/blog\/#\/schema\/person\/301c405ff2c201a381ea126a3698a888\",\"name\":\"ashwani Kumar\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.cotocus.com\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/a3242d067120cf1862729f6a97db1450cae84ae1186e6adc0736f49282630d21?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/a3242d067120cf1862729f6a97db1450cae84ae1186e6adc0736f49282630d21?s=96&d=mm&r=g\",\"caption\":\"ashwani Kumar\"},\"url\":\"https:\/\/www.cotocus.com\/blog\/author\/ashwani\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"PHP Tutorial for Beginners - Cotocus","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.cotocus.com\/blog\/php-tutorial-for-beginners\/","og_locale":"en_US","og_type":"article","og_title":"PHP Tutorial for Beginners - Cotocus","og_description":"PHP FRONT TO BACK* **What is PHP? :- PHP: Hypertext Preprocessor(Recursive Acronym) Server Side Programming\/Scripting Language Can be embedded directly within HTML (&lt;?php?&gt;) Files use [...]","og_url":"https:\/\/www.cotocus.com\/blog\/php-tutorial-for-beginners\/","og_site_name":"Cotocus","article_published_time":"2019-09-06T13:27:07+00:00","article_modified_time":"2023-09-10T08:19:21+00:00","og_image":[{"width":1406,"height":752,"url":"https:\/\/www.cotocus.com\/blog\/wp-content\/uploads\/2019\/09\/php.png","type":"image\/png"}],"author":"ashwani Kumar","twitter_card":"summary_large_image","twitter_misc":{"Written by":"ashwani Kumar","Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.cotocus.com\/blog\/php-tutorial-for-beginners\/#article","isPartOf":{"@id":"https:\/\/www.cotocus.com\/blog\/php-tutorial-for-beginners\/"},"author":{"name":"ashwani Kumar","@id":"https:\/\/www.cotocus.com\/blog\/#\/schema\/person\/301c405ff2c201a381ea126a3698a888"},"headline":"PHP Tutorial for Beginners","datePublished":"2019-09-06T13:27:07+00:00","dateModified":"2023-09-10T08:19:21+00:00","mainEntityOfPage":{"@id":"https:\/\/www.cotocus.com\/blog\/php-tutorial-for-beginners\/"},"wordCount":342,"commentCount":0,"image":{"@id":"https:\/\/www.cotocus.com\/blog\/php-tutorial-for-beginners\/#primaryimage"},"thumbnailUrl":"https:\/\/www.cotocus.com\/blog\/wp-content\/uploads\/2019\/09\/php.png","keywords":["Beginners","php","tutorial"],"articleSection":["Php"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.cotocus.com\/blog\/php-tutorial-for-beginners\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.cotocus.com\/blog\/php-tutorial-for-beginners\/","url":"https:\/\/www.cotocus.com\/blog\/php-tutorial-for-beginners\/","name":"PHP Tutorial for Beginners - Cotocus","isPartOf":{"@id":"https:\/\/www.cotocus.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.cotocus.com\/blog\/php-tutorial-for-beginners\/#primaryimage"},"image":{"@id":"https:\/\/www.cotocus.com\/blog\/php-tutorial-for-beginners\/#primaryimage"},"thumbnailUrl":"https:\/\/www.cotocus.com\/blog\/wp-content\/uploads\/2019\/09\/php.png","datePublished":"2019-09-06T13:27:07+00:00","dateModified":"2023-09-10T08:19:21+00:00","author":{"@id":"https:\/\/www.cotocus.com\/blog\/#\/schema\/person\/301c405ff2c201a381ea126a3698a888"},"breadcrumb":{"@id":"https:\/\/www.cotocus.com\/blog\/php-tutorial-for-beginners\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.cotocus.com\/blog\/php-tutorial-for-beginners\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.cotocus.com\/blog\/php-tutorial-for-beginners\/#primaryimage","url":"https:\/\/www.cotocus.com\/blog\/wp-content\/uploads\/2019\/09\/php.png","contentUrl":"https:\/\/www.cotocus.com\/blog\/wp-content\/uploads\/2019\/09\/php.png","width":1406,"height":752},{"@type":"BreadcrumbList","@id":"https:\/\/www.cotocus.com\/blog\/php-tutorial-for-beginners\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.cotocus.com\/blog\/"},{"@type":"ListItem","position":2,"name":"PHP Tutorial for Beginners"}]},{"@type":"WebSite","@id":"https:\/\/www.cotocus.com\/blog\/#website","url":"https:\/\/www.cotocus.com\/blog\/","name":"Cotocus","description":"Shaping Tomorrow\u2019s Tech Today","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.cotocus.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/www.cotocus.com\/blog\/#\/schema\/person\/301c405ff2c201a381ea126a3698a888","name":"ashwani Kumar","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.cotocus.com\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/a3242d067120cf1862729f6a97db1450cae84ae1186e6adc0736f49282630d21?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/a3242d067120cf1862729f6a97db1450cae84ae1186e6adc0736f49282630d21?s=96&d=mm&r=g","caption":"ashwani Kumar"},"url":"https:\/\/www.cotocus.com\/blog\/author\/ashwani\/"}]}},"_links":{"self":[{"href":"https:\/\/www.cotocus.com\/blog\/wp-json\/wp\/v2\/posts\/1308","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.cotocus.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.cotocus.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.cotocus.com\/blog\/wp-json\/wp\/v2\/users\/14"}],"replies":[{"embeddable":true,"href":"https:\/\/www.cotocus.com\/blog\/wp-json\/wp\/v2\/comments?post=1308"}],"version-history":[{"count":1,"href":"https:\/\/www.cotocus.com\/blog\/wp-json\/wp\/v2\/posts\/1308\/revisions"}],"predecessor-version":[{"id":1310,"href":"https:\/\/www.cotocus.com\/blog\/wp-json\/wp\/v2\/posts\/1308\/revisions\/1310"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.cotocus.com\/blog\/wp-json\/wp\/v2\/media\/1309"}],"wp:attachment":[{"href":"https:\/\/www.cotocus.com\/blog\/wp-json\/wp\/v2\/media?parent=1308"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.cotocus.com\/blog\/wp-json\/wp\/v2\/categories?post=1308"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.cotocus.com\/blog\/wp-json\/wp\/v2\/tags?post=1308"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}