{"id":8065,"date":"2021-08-18T06:16:33","date_gmt":"2021-08-18T06:16:33","guid":{"rendered":"https:\/\/www.scmgalaxy.com\/tutorials\/?p=8065"},"modified":"2021-08-18T06:16:34","modified_gmt":"2021-08-18T06:16:34","slug":"advance-php-2","status":"publish","type":"post","link":"https:\/\/www.scmgalaxy.com\/tutorials\/advance-php-2\/","title":{"rendered":"Advance PHP"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">In core PHP we learn only the basic elements but in advanced PHP we are learning many other elements or their uses in real-life projects that is why it is called <strong>advanced PHP<\/strong>. Remember that there is <strong>no difference between core PHP and advanced PHP.<\/strong><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">why we should learn advanced php?<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">The good feature of PHP is that it is very robust and scalable. PHP is much the same as if it was an object-oriented language, making it a very easy language to deal with. PHP also has a very strong meta-language for programmers. PHP has increased demand for language development year over year.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Class &amp; Object<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">Class:-<\/h3>\n\n\n\n<ul class=\"wp-block-list\"><li>PHP class is a <strong>group of values and a set of operations to manipulate the value or to change the value<\/strong>.<\/li><li>Classes are\u00a0the <strong>blueprints <\/strong>of objects.<\/li><li>Classes\u00a0are nothing without<strong> objects<\/strong>.<\/li><li>Class\u00a0is a programmer-defined<strong>\u00a0data type<\/strong>.<\/li><li>The syntax for\u00a0defining\u00a0a\u00a0class in PHP\u00a0is<strong> very simple<\/strong>.<\/li><li>We use the keyword\u00a0<strong>class\u00a0<\/strong>followed by the name of the\u00a0<strong>class<\/strong>.<\/li><\/ul>\n\n\n\n<h3 class=\"wp-block-heading\">Rules for creating class:-<\/h3>\n\n\n\n<ul class=\"wp-block-list\"><li>Class name can be any valid label like(Vikash,Ram,Boss,Cat,Plant e.t.c).<\/li><li>Cannot be used Php reserved words.<\/li><li>The class name, should start with letter or underscore.<\/li><li>for remembering class, the class name starts with the first capital letter.<\/li><\/ul>\n\n\n\n<h3 class=\"wp-block-heading\">syntax:-<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code><span class=\"has-inline-color has-vivid-red-color\">class<\/span><span class=\"has-inline-color has-vivid-cyan-blue-color\"> Classname<\/span>\n{\nvar&amp;variable_name;\nvar&amp;variable_name;\nvar&amp;variable_name;\n\nfunction Method_name()\n{\nbody of method;\n}\n\nfunction Method_name()\n{\nbody of method;\n}\n\nfunction Method_name(parameter_list)\n{\nbody of method;\n}\n\n}\n<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">Object:-<\/h3>\n\n\n\n<ul class=\"wp-block-list\"><li>Objects are defined from <strong>classes<\/strong>.<\/li><li>An object of a class <strong>a copy of each variable defined in the class<\/strong> is created.<\/li><li>Classes are nothing without<strong>\u00a0objects<\/strong>.<\/li><li>We can create<strong> multiple<\/strong>\u00a0objects\u00a0from a class.<\/li><\/ul>\n\n\n\n<h3 class=\"wp-block-heading\">Syntax:-<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>$Object_name=<span class=\"has-inline-color has-vivid-red-color\">new<\/span> <span class=\"has-inline-color has-vivid-cyan-blue-color\">class_name<\/span>;<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>In core PHP we learn only the basic elements but in advanced PHP we are learning many other elements or [&hellip;]<\/p>\n","protected":false},"author":34,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_joinchat":[],"footnotes":""},"categories":[5388],"tags":[6376,6378,6379,1122,6380,177,593,6381,6382,6383,213,6377],"class_list":["post-8065","post","type-post","status-publish","format-standard","hentry","category-php","tag-advance-php","tag-class-object-in-php","tag-classes-in-php","tag-guide","tag-object-in-php","tag-php","tag-process","tag-rules-for-creating-class","tag-syntax-for-class","tag-syntax-for-object","tag-tutorial","tag-why-we-should-lean-advance-php"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v28.4 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Advance PHP - scmGalaxy<\/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.scmgalaxy.com\/tutorials\/advance-php-2\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Advance PHP - scmGalaxy\" \/>\n<meta property=\"og:description\" content=\"In core PHP we learn only the basic elements but in advanced PHP we are learning many other elements or [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.scmgalaxy.com\/tutorials\/advance-php-2\/\" \/>\n<meta property=\"og:site_name\" content=\"scmGalaxy\" \/>\n<meta property=\"article:published_time\" content=\"2021-08-18T06:16:33+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2021-08-18T06:16:34+00:00\" \/>\n<meta name=\"author\" content=\"vikashdev k\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"vikashdev k\" \/>\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.scmgalaxy.com\\\/tutorials\\\/advance-php-2\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/advance-php-2\\\/\"},\"author\":{\"name\":\"vikashdev k\",\"@id\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/#\\\/schema\\\/person\\\/ec4d1004b3acffc7df65899e880c7515\"},\"headline\":\"Advance PHP\",\"datePublished\":\"2021-08-18T06:16:33+00:00\",\"dateModified\":\"2021-08-18T06:16:34+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/advance-php-2\\\/\"},\"wordCount\":259,\"commentCount\":0,\"keywords\":[\"advance php\",\"class &amp; object in php\",\"classes in php\",\"Guide\",\"object in php\",\"Php\",\"Process\",\"rules for creating class\",\"syntax for class\",\"syntax for object\",\"Tutorial\",\"why we should lean advance php\"],\"articleSection\":[\"php\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/advance-php-2\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/advance-php-2\\\/\",\"url\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/advance-php-2\\\/\",\"name\":\"Advance PHP - scmGalaxy\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/#website\"},\"datePublished\":\"2021-08-18T06:16:33+00:00\",\"dateModified\":\"2021-08-18T06:16:34+00:00\",\"author\":{\"@id\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/#\\\/schema\\\/person\\\/ec4d1004b3acffc7df65899e880c7515\"},\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/advance-php-2\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/advance-php-2\\\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/advance-php-2\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Advance PHP\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/#website\",\"url\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/\",\"name\":\"scmGalaxy\",\"description\":\"A Platform for Software Engineers\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/#\\\/schema\\\/person\\\/ec4d1004b3acffc7df65899e880c7515\",\"name\":\"vikashdev k\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/738fe2694a5769295d6bbe57066232fcf8351e09ce1090f200c7b34f770fa61b?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/738fe2694a5769295d6bbe57066232fcf8351e09ce1090f200c7b34f770fa61b?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/738fe2694a5769295d6bbe57066232fcf8351e09ce1090f200c7b34f770fa61b?s=96&d=mm&r=g\",\"caption\":\"vikashdev k\"},\"url\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/author\\\/vikashdev\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Advance PHP - scmGalaxy","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.scmgalaxy.com\/tutorials\/advance-php-2\/","og_locale":"en_US","og_type":"article","og_title":"Advance PHP - scmGalaxy","og_description":"In core PHP we learn only the basic elements but in advanced PHP we are learning many other elements or [&hellip;]","og_url":"https:\/\/www.scmgalaxy.com\/tutorials\/advance-php-2\/","og_site_name":"scmGalaxy","article_published_time":"2021-08-18T06:16:33+00:00","article_modified_time":"2021-08-18T06:16:34+00:00","author":"vikashdev k","twitter_card":"summary_large_image","twitter_misc":{"Written by":"vikashdev k","Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.scmgalaxy.com\/tutorials\/advance-php-2\/#article","isPartOf":{"@id":"https:\/\/www.scmgalaxy.com\/tutorials\/advance-php-2\/"},"author":{"name":"vikashdev k","@id":"https:\/\/www.scmgalaxy.com\/tutorials\/#\/schema\/person\/ec4d1004b3acffc7df65899e880c7515"},"headline":"Advance PHP","datePublished":"2021-08-18T06:16:33+00:00","dateModified":"2021-08-18T06:16:34+00:00","mainEntityOfPage":{"@id":"https:\/\/www.scmgalaxy.com\/tutorials\/advance-php-2\/"},"wordCount":259,"commentCount":0,"keywords":["advance php","class &amp; object in php","classes in php","Guide","object in php","Php","Process","rules for creating class","syntax for class","syntax for object","Tutorial","why we should lean advance php"],"articleSection":["php"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.scmgalaxy.com\/tutorials\/advance-php-2\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.scmgalaxy.com\/tutorials\/advance-php-2\/","url":"https:\/\/www.scmgalaxy.com\/tutorials\/advance-php-2\/","name":"Advance PHP - scmGalaxy","isPartOf":{"@id":"https:\/\/www.scmgalaxy.com\/tutorials\/#website"},"datePublished":"2021-08-18T06:16:33+00:00","dateModified":"2021-08-18T06:16:34+00:00","author":{"@id":"https:\/\/www.scmgalaxy.com\/tutorials\/#\/schema\/person\/ec4d1004b3acffc7df65899e880c7515"},"breadcrumb":{"@id":"https:\/\/www.scmgalaxy.com\/tutorials\/advance-php-2\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.scmgalaxy.com\/tutorials\/advance-php-2\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.scmgalaxy.com\/tutorials\/advance-php-2\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.scmgalaxy.com\/tutorials\/"},{"@type":"ListItem","position":2,"name":"Advance PHP"}]},{"@type":"WebSite","@id":"https:\/\/www.scmgalaxy.com\/tutorials\/#website","url":"https:\/\/www.scmgalaxy.com\/tutorials\/","name":"scmGalaxy","description":"A Platform for Software Engineers","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.scmgalaxy.com\/tutorials\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/www.scmgalaxy.com\/tutorials\/#\/schema\/person\/ec4d1004b3acffc7df65899e880c7515","name":"vikashdev k","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/738fe2694a5769295d6bbe57066232fcf8351e09ce1090f200c7b34f770fa61b?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/738fe2694a5769295d6bbe57066232fcf8351e09ce1090f200c7b34f770fa61b?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/738fe2694a5769295d6bbe57066232fcf8351e09ce1090f200c7b34f770fa61b?s=96&d=mm&r=g","caption":"vikashdev k"},"url":"https:\/\/www.scmgalaxy.com\/tutorials\/author\/vikashdev\/"}]}},"_links":{"self":[{"href":"https:\/\/www.scmgalaxy.com\/tutorials\/wp-json\/wp\/v2\/posts\/8065","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.scmgalaxy.com\/tutorials\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.scmgalaxy.com\/tutorials\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.scmgalaxy.com\/tutorials\/wp-json\/wp\/v2\/users\/34"}],"replies":[{"embeddable":true,"href":"https:\/\/www.scmgalaxy.com\/tutorials\/wp-json\/wp\/v2\/comments?post=8065"}],"version-history":[{"count":1,"href":"https:\/\/www.scmgalaxy.com\/tutorials\/wp-json\/wp\/v2\/posts\/8065\/revisions"}],"predecessor-version":[{"id":8066,"href":"https:\/\/www.scmgalaxy.com\/tutorials\/wp-json\/wp\/v2\/posts\/8065\/revisions\/8066"}],"wp:attachment":[{"href":"https:\/\/www.scmgalaxy.com\/tutorials\/wp-json\/wp\/v2\/media?parent=8065"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.scmgalaxy.com\/tutorials\/wp-json\/wp\/v2\/categories?post=8065"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.scmgalaxy.com\/tutorials\/wp-json\/wp\/v2\/tags?post=8065"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}