gdata.io.handleScriptLoaded({"version":"1.0","encoding":"UTF-8","feed":{"xmlns":"http://www.w3.org/2005/Atom","xmlns$openSearch":"http://a9.com/-/spec/opensearchrss/1.0/","xmlns$gd":"http://schemas.google.com/g/2005","xmlns$georss":"http://www.georss.org/georss","xmlns$thr":"http://purl.org/syndication/thread/1.0","xmlns$blogger":"http://schemas.google.com/blogger/2008","id":{"$t":"tag:blogger.com,1999:blog-4095748245355156272"},"updated":{"$t":"2023-12-23T10:10:36.395+05:30"},"category":[{"term":"Make Money"},{"term":"Earn Tricks"},{"term":"PC Tips"},{"term":"Sundar Pichai"},{"term":"Cash"},{"term":"PayPal"},{"term":"DATABASE"},{"term":"Neal Mohan"},{"term":"internet"},{"term":"Wrong answer"},{"term":"email"},{"term":"CEO"},{"term":"boot"},{"term":"functions"},{"term":"installation process"},{"term":"Remote employees"},{"term":"facebook"},{"term":"Apache"},{"term":"data types"},{"term":"Encapsulation"},{"term":"Hosting"},{"term":"Launch"},{"term":"Website"},{"term":"microsoft"},{"term":"Maximize earning potential"},{"term":"Facebook Tips"},{"term":"whatsapp"},{"term":"Inheritance"},{"term":"google"},{"term":"Free Antivirus n key"},{"term":"Pc Tricks"},{"term":"computer"},{"term":"navbar"},{"term":"Content"},{"term":"Facebook Timeline"},{"term":"NASA"},{"term":"free"},{"term":"Object-Oriented Programming"},{"term":"Spare time"},{"term":"James Webb Space Telescope"},{"term":"tool"},{"term":"Points"},{"term":"Top Ten Antivirus 2012"},{"term":"Tasks"},{"term":"Funny Java Tricks"},{"term":"programming"},{"term":"software bundle"},{"term":"Work from home"},{"term":"Chatbot"},{"term":"Freelancing"},{"term":"Howto"},{"term":"PHP"},{"term":"youtube"},{"term":"Step-by-step guide"},{"term":"Best  Tricks"},{"term":"ChatGPT"},{"term":"Mobile app"},{"term":"Free Sms to World"},{"term":"Web Traffic"},{"term":"tricks"},{"term":"file handling"},{"term":"Best  Tips"},{"term":"Learn PHP"},{"term":"NEWS"},{"term":"XAMPP"},{"term":"LG"},{"term":"AI"},{"term":"Bard"},{"term":"Telecommuting"},{"term":"Remote work"},{"term":"Flexible work"},{"term":"Orkut Ha(k"},{"term":"Online jobs"},{"term":"leptop"},{"term":"Remote work culture"},{"term":"Videos"},{"term":"format"},{"term":"Article"},{"term":"Instagram"},{"term":"hotspot"},{"term":"Android"},{"term":"Susan Wojcicki"},{"term":"Trading"},{"term":"control structures"},{"term":"Gift cards"},{"term":"PHP applications"},{"term":"Net tips"},{"term":"MYSQL"},{"term":"Search engines"},{"term":"Earn money online"},{"term":"MariaDB"},{"term":"Market value"},{"term":"web development"},{"term":"OpenAI"},{"term":"Mobile Tips"},{"term":"gadgets"},{"term":"Net Funny Tricks"},{"term":"blog"},{"term":"web applications"},{"term":"Windows Tricks"},{"term":"wifi"},{"term":"Abstraction"},{"term":"Polymorphism"},{"term":"windows"},{"term":"Wechat"},{"term":"computer setup"},{"term":"highspeed"},{"term":"MVC"},{"term":"dynamic content"},{"term":"4GSpeed"},{"term":"Facebook Tricks"},{"term":"Safe On Facebook"},{"term":"mobile"},{"term":"Atta Pol"},{"term":"variables"},{"term":"recharge"},{"term":"SEO Tips"},{"term":"iOS"},{"term":"PHP programming"},{"term":"Mobile as a Webcam"},{"term":"Remote jobs"},{"term":"database connectivity"},{"term":"Artificial Intelligence"},{"term":"Free Call"},{"term":"Rewards"},{"term":"Surveys"},{"term":"bootable pendrive"},{"term":"Blogger Tricks"},{"term":"Orkut tips"},{"term":"FB Status Updater"},{"term":"Post"},{"term":"OOP"},{"term":"Share price"},{"term":"Extra income"},{"term":"operators"},{"term":"web server"},{"term":"bluestacks"},{"term":"PHP scripts"},{"term":"Blogger Widgets"},{"term":"Java Tricks"},{"term":"Alphabet"},{"term":"scripting language"},{"term":"Virtual work"}],"title":{"type":"text","$t":"Get Tricks - All Type of Tricks"},"subtitle":{"type":"html","$t":"The site gives knowledge and tricks about social sites, computer tricks, the Internet and earning money online. All Information and tips are in One Place."},"link":[{"rel":"http://schemas.google.com/g/2005#feed","type":"application/atom+xml","href":"https://www.blogger.com/feeds/4095748245355156272/posts/default/-/MYSQL?alt\u003djson-in-script\u0026max-results\u003d5"},{"rel":"self","type":"application/atom+xml","href":"https://www.blogger.com/feeds/4095748245355156272/posts/default/-/MYSQL?alt\u003djson-in-script\u0026max-results\u003d5"},{"rel":"alternate","type":"text/html","href":"http://www.gettrickz.com/search/label/MYSQL"},{"rel":"hub","href":"http://pubsubhubbub.appspot.com/"}],"author":[{"name":{"$t":"Juber Khan Baloch"},"uri":{"$t":"https://www.blogger.com/profile/03500557746501068520"},"email":{"$t":"noreply@blogger.com"},"gd$image":{"rel":"http://schemas.google.com/g/2005#thumbnail","width":"35","height":"35","src":"//www.blogger.com/img/blogger_logo_round_35.png"}}],"generator":{"version":"7.00","uri":"https://www.blogger.com","$t":"Blogger"},"openSearch$totalResults":{"$t":"5"},"openSearch$startIndex":{"$t":"1"},"openSearch$itemsPerPage":{"$t":"5"},"entry":[{"id":{"$t":"tag:blogger.com,1999:blog-4095748245355156272.post-1436035524094031151"},"published":{"$t":"2023-02-17T13:28:00.010+05:30"},"updated":{"$t":"2023-02-25T00:14:53.502+05:30"},"category":[{"scheme":"http://www.blogger.com/atom/ns#","term":"OOP"},{"scheme":"http://www.blogger.com/atom/ns#","term":"Learn PHP"},{"scheme":"http://www.blogger.com/atom/ns#","term":"Encapsulation"},{"scheme":"http://www.blogger.com/atom/ns#","term":"Abstraction"},{"scheme":"http://www.blogger.com/atom/ns#","term":"MYSQL"},{"scheme":"http://www.blogger.com/atom/ns#","term":"Inheritance"},{"scheme":"http://www.blogger.com/atom/ns#","term":"PHP"},{"scheme":"http://www.blogger.com/atom/ns#","term":"Howto"},{"scheme":"http://www.blogger.com/atom/ns#","term":"Object-Oriented Programming"},{"scheme":"http://www.blogger.com/atom/ns#","term":"Polymorphism"}],"title":{"type":"text","$t":" Start Learn PHP/MYSQL : How to Do Object Oriented Programming(OOP) in PHP( Easy Explained )"},"content":{"type":"html","$t":"\u003cdiv class\u003d\"separator\" style\u003d\"clear: both;\"\u003e\u003cdiv class\u003d\"separator\" style\u003d\"clear: both; text-align: center;\"\u003e\u003ca href\u003d\"https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjbDL56QCWVnfsLzlYPHiit0EwPFYUem83KHaGr_1B9TRWU_AQqpJLUNVAuvz1twgJfzJ_4vYxMsPX7C8sgqNq3SY-_E79jGkDZIFkJnwox5oJwwzKp9B5zWIbyTwuCzx7fvL2YSMMUG23cCAhFWRT4HjXEYmGcAL9x_jJSFuAsh3Y-7hq09CCb1wi02w/s1024/Object-Oriented-Programming-in-PHP.jpg\" style\u003d\"clear: left; float: left; margin-bottom: 1em; margin-right: 1em;\"\u003e\u003cimg border\u003d\"0\" data-original-height\u003d\"687\" data-original-width\u003d\"1024\" height\u003d\"215\" src\u003d\"https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjbDL56QCWVnfsLzlYPHiit0EwPFYUem83KHaGr_1B9TRWU_AQqpJLUNVAuvz1twgJfzJ_4vYxMsPX7C8sgqNq3SY-_E79jGkDZIFkJnwox5oJwwzKp9B5zWIbyTwuCzx7fvL2YSMMUG23cCAhFWRT4HjXEYmGcAL9x_jJSFuAsh3Y-7hq09CCb1wi02w/s320/Object-Oriented-Programming-in-PHP.jpg\" width\u003d\"320\" /\u003e\u003c/a\u003e\u003c/div\u003e\u003cp\u003eObject-oriented programming(OOP) is a popular programming model used in present time software development. With OOP, programmers can organize code into reusable, modular components, which makes software development more efficient and easier to maintain. PHP, one of the most popular server side scripting languages,supports OOP concepts and provides developers with powerful tools to create robust and scalable applications.\u003c/p\u003e\u003cp\u003eIn this article we will take closer look at oops in PHP and explore benefits it offers to developers.We will also discuss essential OOP concepts and how to use them in PHP programming.\u003c/p\u003e\n\u003ch3\u003eWhat is Object-Oriented Programming.(OOP)?\u003c/h3\u003e\n\u003cp\u003eObject-Oriented Programming is a programming model that focuses on creating software components that can be reused and combined to create complex/big applications.OOP is built around the concept of objects which represent real world entities or concepts. An object is a self contained unit that has properties and methods that define its behaviour.\u003c/p\u003e\n\u003ch3\u003ePHP and OOP:\u003c/h3\u003e\n\u003cp\u003ePHP supports OOP concepts and starting from PHP5 it provides robust support for OOP programming. OOP in PHP enables developers to create complex applications by breaking them down into smaller, reusable components. OOP in PHP allows developers to write more organized and maintainable code which is easier to debug and extend.\u003c/p\u003e\n\u003cp\u003eObject-Oriented Programming(OOP) in PHP has a large number of methods and keywords that are used to create classes,objects \u0026 methods.Here are some of most commonly used Object-Oriented Programming methods and keywords in PHP programming:\u003c/p\u003e\n  \u003col\u003e\u003ch4\u003e\u003cli\u003eMethods:\u003c/li\u003e\u003c/h4\u003e\u003c/ol\u003e\u003cul\u003e\u003cli\u003e\u003cb\u003e__construct()\u003c/b\u003e:a special method that is automatically called when an object is instantiate.\u003c/li\u003e\u003cli\u003e\u003cb\u003e__destruct()\u003c/b\u003e:a special method that is automatically called when an object is destroy.\u003c/li\u003e\u003cli\u003e\u003cb\u003e__get()\u003c/b\u003e: a method that is called when an inaccessible property is accessed.\u003c/li\u003e\u003cli\u003e\u003cb\u003e__set()\u003c/b\u003e: a method that is called when an inaccessible property is set.\u003c/li\u003e\u003cli\u003e\u003cb\u003e__call()\u003c/b\u003e: a method that is called when a not accessible method is called.\u003c/li\u003e\u003cli\u003e\u003cb\u003estatic\u003c/b\u003e: a keyword used to define static methods and properties.\u003c/li\u003e\u003cli\u003e\u003cb\u003efinal\u003c/b\u003e: a keyword used to stop a class from being sub classed or a method from being overridden.\u003c/li\u003e\u003cli\u003e\u003cb\u003eabstract\u003c/b\u003e: a keyword used to define abstract classes \u0026 methods.\u003c/li\u003e\u003cli\u003e\u003cb\u003einterface\u003c/b\u003e: a keyword used to define interfaces.\u003c/li\u003e\u003c/ul\u003e\u003col start\u003d\"2\"\u003e\u003ch4\u003e\u003cli\u003eKeywords:\u003c/li\u003e\u003c/h4\u003e\u003c/ol\u003e\u003cul\u003e\u003cli\u003e\u003cb\u003eclass\u003c/b\u003e:a keyword used to define a class.\u003c/li\u003e\u003cli\u003e\u003cb\u003enew\u003c/b\u003e:a keyword used to create an object instance of a class.\u003c/li\u003e\u003cli\u003e\u003cb\u003eextends \u003c/b\u003e: a keyword used to define inheritance between classes.\u003c/li\u003e\u003cli\u003e\u003cb\u003epublic \u003c/b\u003e:a keyword used to declare a property/method as publicly accessible.\u003c/li\u003e\u003cli\u003e\u003cb\u003eprivate \u003c/b\u003e-a keyword used to declare a property or method as accessible only within the class that defines it\u003c/li\u003e\u003cli\u003e\u003cb\u003eprotected \u003c/b\u003e-a keyword used to declare a property or method as accessible only within the class that defines it and its subclasses\u003c/li\u003e\u003cli\u003e\u003cb\u003ethis \u003c/b\u003e-a keyword used to refer to the current object instance within a class method\u003c/li\u003e\u003cli\u003e\u003cb\u003eself \u003c/b\u003e- a keyword used to refer to the current class within a class method\u003c/li\u003e\u003cli\u003e\u003cb\u003eparent \u003c/b\u003e- a keyword used to refer to the parent class within a class method\u003c/li\u003e\u003c/ul\u003e\u003cp\u003eThese are just a few of the many methods \u0026 keywords available in OOP in PHP. By understanding and using these methods and keywords effectively, you can create more powerful and efficient object-oriented code.\u003c/p\u003e\n\u003ch3\u003eEssential OOP Concepts:\u003c/h3\u003e\n\u003col\u003e\u003ch4\u003e\u003cli\u003eClasses and Objects:\u003c/li\u003e\u003c/h4\u003e\n  \u003cp\u003eClasses define the blueprint or structure of an object, while objects are instances of a class. A class is a template that defines the properties and methods of an object, while an object is a concrete realization of a class.\u003c/p\u003e\n  \u003cp\u003eIn PHP there are three types of classes and objects: regular classes, abstract classes and interfaces.Let's take a look at each of them and their rules.\u003c/p\u003e\n  \u003col\u003e\u003cli\u003e\u003cstrong\u003eRegular Classes\u003c/strong\u003e\nRegular classes are the most common type of class in PHP and they can be instantiated to create objects.These classes can have properties and methods, which can be accessed using object notation.\u003c/li\u003e\u003c/ol\u003e\u003cp\u003eRules:\u003c/p\u003e\u003cul\u003e\u003cli\u003eRegular classes must have a class keyword followed by a name and a set of curly braces.\u003c/li\u003e\u003cli\u003eClass names should follow CamelCase naming convention.\u003c/li\u003e\u003cli\u003eA class must be instantiated before it can be used to create objects.\u003c/li\u003e\u003cli\u003eProperties and methods must have an access modifier, which determines their visibility.The three access modifiers are public, protected and private.\u003c/li\u003e\u003cli\u003eA class can inherit from another class using the extends keyword.\u003c/li\u003e\u003c/ul\u003e\u003cp\u003eExample:\u003c/p\u003e\n  \n \u003cdiv class \u003d\"clsviewer \" \u003e\n  \u003cdiv class \u003d\"clsheader \"\u003e\n             \u003ci class \u003d\" languagecls \"\u003e  PHP \u003c/i\u003e \n  \u003c/div\u003e\n  \u003c pre class\u003d\"ccontentclss \" \u003e\n\u003ccode\u003e \n \n \u0026lt;?php  \n \nclass Car {\n    public $make;\n    public $model;\n\n    public function start() {\n        //code to start the car\n    }\n\n    private function checkFuel() {\n        //code to check the level of  fuel \n    }\n}\n\n\n ?\u0026gt;  \n  \u003c/code\u003e\u003c/pre\u003e\n\u003c/div\u003e\n  \u003col start\u003d\"2\"\u003e\u003cli\u003e\u003cstrong\u003eAbstract Classes\u003c/strong\u003e\nAbstract classes are similar to regular classes but they cannot be instantiated on their own. Instead, they are meant to be extended by other classes. Abstract classes can have abstract methods, which are methods without implementation.These methods must be implemented by any class that extends the abstract class.\u003c/li\u003e\u003c/ol\u003e\u003cp\u003eRules:\u003c/p\u003e\u003cul\u003e\u003cli\u003eAbstract classes must have an abstract keyword before the class keyword.\u003c/li\u003e\u003cli\u003eAn abstract class cannot be instantiated on its own.\u003c/li\u003e\u003cli\u003eAbstract classes can have abstract methods which are declared without an implementation.\u003c/li\u003e\u003cli\u003eAny class that extends an abstract class must implement all of its abstract methods.\u003c/li\u003e\u003c/ul\u003e\u003cp\u003eExample:\u003c/p\u003e\n   \n \u003cdiv class \u003d\"clsviewer \" \u003e\n  \u003cdiv class \u003d\"clsheader \"\u003e\n             \u003ci class \u003d\" languagecls \"\u003e  PHP \u003c/i\u003e \n  \u003c/div\u003e\n  \u003c pre class\u003d\"ccontentclss \" \u003e\n\u003ccode\u003e \n \n \u0026lt;?php  \n \nabstract class Vehicle {\n    public $make;\n    public $model;\n\n    abstract public function start();\n}\n\n\n\n ?\u0026gt;  \n  \u003c/code\u003e\u003c/pre\u003e\n\u003c/div\u003e\n  \u003col start\u003d\"3\"\u003e\u003cli\u003e\u003cstrong\u003eInterfaces\u003c/strong\u003e\nInterfaces are alike to abstract classes but they can only have method signatures and constants.Any class that implements an interface must implement all of its methods. Interfaces are used to define a set of methods that must be implemented by any class that wants to use them.\u003c/li\u003e\u003c/ol\u003e\u003cp\u003eRules: \u003c/p\u003e\u003cul\u003e\u003cli\u003e Interfaces must have an interface keyword followed by a name and a set of curly braces.\u003c/li\u003e\u003cli\u003eInterfaces can only have method signatures and constants not properties or method implementations.\u003c/li\u003e\u003cli\u003eAny class that implements an interface must implement all of its methods.\u003c/li\u003e\u003c/ul\u003e\u003cp\u003e Example:\u003c/p\u003e\n \n \u003cdiv class \u003d\"clsviewer \" \u003e\n  \u003cdiv class \u003d\"clsheader \"\u003e\n             \u003ci class \u003d\" languagecls \"\u003e  PHP \u003c/i\u003e \n  \u003c/div\u003e\n  \u003c pre class\u003d\"ccontentclss \" \u003e\n\u003ccode\u003e \n \n \u0026lt;?php  \n \ninterface Printable {\n    public function print();\n}\n\n\n\n\n ?\u0026gt;  \n  \u003c/code\u003e\u003c/pre\u003e\n\u003c/div\u003e\n  \u003cp\u003eIn summary regular classes, abstract classes and interfaces all have different rules and use cases in PHP. Regular classes are the most common and can be instantiated to create objects while abstract classes and interfaces are used for more specialized cases, such as creating blueprints for other classes or defining a set of methods that must be implemented by other classes.\u003c/p\u003e\n  \n \u003cp\u003eFull Example of classes and objects in PHP.Imagine we are building a simple website for a library, and we want to create a class for the books that will be displayed on the site.We can create a Book class that will have properties for the title, author, and number of pages.\u003c/p\u003e\n  \n \n \u003cdiv class \u003d\"clsviewer \" \u003e\n  \u003cdiv class \u003d\"clsheader \"\u003e\n             \u003ci class \u003d\" languagecls \"\u003e  PHP \u003c/i\u003e \n  \u003c/div\u003e\n  \u003c pre class\u003d\"ccontentclss \" \u003e\n\u003ccode\u003e \n \n \u0026lt;?php  \n \n class Book {  \n   public $title;  \n   public $author;  \n   public $pages;  \n }  \n ?\u0026gt;  \n  \u003c/code\u003e\u003c/pre\u003e\n\u003c/div\u003e\n  \n  \u003cp\u003eWe can then create object of the BOOK class and set its properties... \u003c/p\u003e\n   \n \u003cdiv class \u003d\"clsviewer \" \u003e\n  \u003cdiv class \u003d\"clsheader \"\u003e\n             \u003ci class \u003d\" languagecls \"\u003e  PHP \u003c/i\u003e \n  \u003c/div\u003e\n  \u003c pre class\u003d\"ccontentclss \" \u003e\n\u003ccode\u003e \n \n \u0026lt;?php  \n \n$book1 \u003d new Book();\n$book1-\u0026gt;title \u003d \"To Kill a Mockingbirds\";\n$book1-\u0026gt;author \u003d \"Harry Lee\";\n$book1-\u0026gt;pages \u003d 281;\n\n ?\u0026gt;  \n  \u003c/code\u003e\u003c/pre\u003e\n\u003c/div\u003e\n  \u003cp\u003eWe can also create additional objects of the BOOK class and set their properties...\u003c/p\u003e\n   \n \u003cdiv class \u003d\"clsviewer \" \u003e\n  \u003cdiv class \u003d\"clsheader \"\u003e\n             \u003ci class \u003d\" languagecls \"\u003e  PHP \u003c/i\u003e \n  \u003c/div\u003e\n  \u003c pre class\u003d\"ccontentclss \" \u003e\n\u003ccode\u003e \n  \n \u0026lt;?php  \n \n$book2 \u003d new Book();\n$book2-\u0026gt;title \u003d \"The Great Gat sby\";\n$book2-\u0026gt;author \u003d \"F. Scott Fitz gerald\";\n$book2-\u0026gt;pages \u003d 180;\n\n$book3 \u003d new Book();\n$book3-\u0026gt;title \u003d \"Pride and Pre judice\";\n$book3-\u0026gt;author \u003d \"Jane Aus\";\n$book3-\u0026gt;pages \u003d 279;\n\n\n ?\u0026gt;  \n  \u003c/code\u003e\u003c/pre\u003e\n\u003c/div\u003e\n\n  \u003cp\u003eWe can then display the properties of each object using the echo statement.\u003c/p\u003e\n  \n \u003cdiv class \u003d\"clsviewer \" \u003e\n  \u003cdiv class \u003d\"clsheader \"\u003e\n             \u003ci class \u003d\" languagecls \"\u003e  PHP \u003c/i\u003e \n  \u003c/div\u003e\n  \u003c pre class\u003d\"ccontentclss \" \u003e\n\u003ccode\u003e \n \n \u0026lt;?php  \n \necho $book1-\u0026gt;title; // Output: To Kill a Mockingbird\necho $book2-\u0026gt;author; // Output: F. Scott Fitzgerald\necho $book3-\u0026gt;pages; // Output: 279\n\n\n\n ?\u0026gt;  \n  \u003c/code\u003e\u003c/pre\u003e\n\u003c/div\u003e\n  \u003cp\u003eWe can also define methods with in the Book class to perform various tasks such as calculating the number of pages read per hour.\u003c/p\u003e\n   \n \u003cdiv class \u003d\"clsviewer \" \u003e\n  \u003cdiv class \u003d\"clsheader \"\u003e\n             \u003ci class \u003d\" languagecls \"\u003e  PHP \u003c/i\u003e \n  \u003c/div\u003e\n  \u003c pre class\u003d\"ccontentclss \" \u003e\n\u003ccode\u003e \n \n \u0026lt;?php  \n \nclass Book {\n    public $title;\n    public $author;\n    public $pages;\n\n    public function readPagesPerHour($hours) {\n        return $this-\u0026gt;pages / $hours;\n    }\n}\n\n\n ?\u0026gt;  \n  \u003c/code\u003e\u003c/pre\u003e\n\u003c/div\u003e\n  \u003cp\u003eWe can then call method on an object of the BOOK class...\u003c/p\u003e\n  \n \u003cdiv class \u003d\"clsviewer \" \u003e\n  \u003cdiv class \u003d\"clsheader \"\u003e\n             \u003ci class \u003d\" languagecls \"\u003e  PHP \u003c/i\u003e \n  \u003c/div\u003e\n  \u003c pre class\u003d\"ccontentclss \" \u003e\n\u003ccode\u003e \n \n \u0026lt;?php  \n \n$book1 \u003d new Book();\n$book1-\u0026gt;title \u003d \"To Kill a Mockingbird\";\n$book1-\u0026gt;author \u003d \"Harper Lee\";\n$book1-\u0026gt;pages \u003d 281;\n\necho $book1-\u0026gt;readPagesPerHour(2); // Output: 140.5\n\n ?\u0026gt;  \n  \u003c/code\u003e\u003c/pre\u003e\n\u003c/div\u003e\n  \u003cp\u003eAs you can see classes and objects in PHP provide a powerful way to encapsulate data and logic in reusable components. By defining a class, we can create multiple instances of that class (i.e.objects) with their own unique properties and methods.This makes our code more modular and easier to maintain as well as more efficient and scalable.\u003c/p\u003e\n  \n  \u003ch4\u003e\u003cli\u003eEncapsulation:\u003c/li\u003e\u003c/h4\u003e\u003ch4\u003e\n    \u003cp\u003e\n     Encapsulation is a mechanism that hides the internal details of an object and exposes only the necessary information. It ensures that the data inside an object is not accessible from outside the object. It is an important concept in Object-Oriented Programming(OOP) that allows you to hide the implementation details of a class from the outside world.This helps to prevent accidental modification of class properties and methods and ensures that they are only accessed and modified in a controlled way. In PHP,encapsulation can be achieved using access modifiers such as public, private and protected.\u003c/p\u003e\n    \u003col\u003e\u003ch5\u003e\u003cli\u003ePublic:\u003c/li\u003e\u003c/h5\u003e\u003c/ol\u003e\u003cp\u003e\nPublic properties and methods are accessible from anywhere in the code both inside and outside of the class. This means that they can be accessed by objects, functions, and other classes.\u003c/p\u003e\n      \u003col start\u003d\"2\"\u003e\u003ch5\u003e\u003cli\u003ePrivate : \u003c/li\u003e\u003c/h5\u003e\u003c/ol\u003e\u003cp\u003e\nPrivate properties and methods are only accessible from with in the class. They cannot be accessed by objects functions or other classes outside of the class. This means that the value of a private property can only be set or retrieved by methods within the same class.\u003c/p\u003e\n    \u003col start\u003d\"3\"\u003e\u003ch5\u003e\u003cli\u003eProtected : \u003c/li\u003e\u003c/h5\u003e\u003c/ol\u003e\u003cp\u003e\nProtected properties and methods are only accessible from within the class and its subclasses. This means that they cannot be accessed by objects or functions outside of the class but they can be accessed by subclasses that inherit from the class.\u003c/p\u003e\n    \n    \u003cp\u003eHere example of Encapsulation in PHP:\u003c/p\u003e\n   \n \u003cdiv class \u003d\"clsviewer \" \u003e\n  \u003cdiv class \u003d\"clsheader \"\u003e\n             \u003ci class \u003d\" languagecls \"\u003e  PHP \u003c/i\u003e \n  \u003c/div\u003e\n  \u003c pre class\u003d\"ccontentclss \" \u003e\n\u003ccode\u003e \n \n \u0026lt;?php  \n \n class BankAccount {  \n   private $balance;  \n   \n   public function deposit($amount) {  \n     $this-\u0026gt;balance +\u003d $amount;  \n   }  \n   \n   public function withdraw($amount) {  \n     if ($amount \u0026lt;\u003d $this-\u0026gt;balance) {  \n       $this-\u0026gt;balance -\u003d $amount;  \n     } else {  \n       echo \"Insufficient funds\";  \n     }  \n   }  \n   \n   public function getBalance() {  \n     return $this-\u0026gt;balance;  \n   }  \n }  \n\n\n ?\u0026gt;  \n  \u003c/code\u003e\u003c/pre\u003e\n\u003c/div\u003e\n    \u003cp\u003eIn this example, we define a Bank Account class with a private property $balance and three methods: deposit(), withdraw()and \u003ccode\u003egetBalance(). The deposit() method allows a user to add money to their account, while the withdraw() method allows them to remove money from their account. The \u003ccode\u003egetBalance()\u003c/code\u003e method allows them to check their current account balance.\u003c/p\u003e\n    \u003cp\u003eNote that the $balance property is marked as private, which means that it can only be accessed within the class itself. This ensures that the balance can only be modified by the deposit() and \u003ccode\u003ewithdraw() methods, and cannot be accessed or modified directly from outside the class. This helps to prevent accidental modification of the balance and ensures that it is only accessed and modified in a controlled way.\u003c/p\u003e\n    \u003cp\u003eHere an example of how to use the Bank Account class:\u003c/p\u003e\n    \n \u003cdiv class \u003d\"clsviewer \" \u003e\n  \u003cdiv class \u003d\"clsheader \"\u003e\n             \u003ci class \u003d\" languagecls \"\u003e  PHP \u003c/i\u003e \n  \u003c/div\u003e\n  \u003c pre class\u003d\"ccontentclss \" \u003e\n\u003ccode\u003e \n  \n \u0026lt;?php  \n$account \u003d new BankAccount();  \n $account-\u0026gt;deposit(1000);  \n $account-\u0026gt;withdraw(500);  \n echo \"Acc Balance: \" . $account-\u0026gt;getBalance();  \n ?\u0026gt;  \n  \u003c/code\u003e\u003c/pre\u003e\n\u003c/div\u003e\n    \u003cp\u003eIn this example we create a new Bank Account object, deposit 1000 into the account, withdraw 500 from the account, and then print the current balance using the getBalance() method. Note that we can only access the balance using the getBalance() method, and cannot modify it directly.\u003c/p\u003e\n    \u003cp\u003eBy encapsulating the balance property and only allowing it to be accessed and modified through controlled methods, we can ensure that the account balance is always accurate and that it cannot be accidentally modified or tampered with.\u003c/p\u003e\n    \n    \u003c/h4\u003e\u003ch4\u003e\u003cli\u003eInheritance:\u003c/li\u003e\u003c/h4\u003e\u003cp\u003eInheritance is a mechanism that enables one class to inherit properties and methods from another class. Inheritance promotes code reuse, and it simplifies the design and maintenance of complex applications.It is a powerful feature in Object-Oriented Programming (OOP) that allows you to create new classes that are based on existing classes, inheriting their properties and methods. In PHP, you can use the extends keyword to create a subclass that inherits from a parent class.\u003c/p\u003e\n    \u003cp\u003eHere example of inheritance in PHP:\u003c/p\u003e\n     \n \u003cdiv class \u003d\"clsviewer \" \u003e\n  \u003cdiv class \u003d\"clsheader \"\u003e\n             \u003ci class \u003d\" languagecls \"\u003e  PHP \u003c/i\u003e \n  \u003c/div\u003e\n  \u003c pre class\u003d\"ccontentclss \" \u003e\n\u003ccode\u003e \n \n  \u003ccode\u003e \n \u0026lt;?php  \n \n class Animal {  \n     protected $name;  \n   protected $color;  \n   \n   public function __construct($name, $color) {  \n          $this-\u0026gt;name \u003d $name;  \n     $this-\u0026gt;color \u003d $color;   \n  }  \n   \n   public function eat() {  \n               echo  \"{$this-\u0026gt;name}    eating...\";     }  \n }  \n   \n class Dog extends Animal {  \n   public function bark() {  \n     echo  \"{$this-\u0026gt;name}    barking...\";   } \n }  \n\n ?\u0026gt;  \n  \u003c/code\u003e\n\u003c/pre\u003e\n\u003c/div\u003e\n  \u003cp\u003e  In this example we define an Animal class with two protected properties ($name and $color) and a eat() method. We then define a Dog class that extends the Animal class, and adds a bark() method.\n    \u003c/p\u003e\u003cp\u003e\nNote that the Dog class uses the extends keyword to inherit from the Animal class.This means that the Dog class will have access to all of the properties and methods of the Animal class, as well as its own bark() method.\u003c/p\u003e\n    \u003cp\u003e Here example of how to use the Dog class:\u003c/p\u003e\n    \n \u003cdiv class \u003d\"clsviewer \" \u003e\n  \u003cdiv class \u003d\"clsheader \"\u003e\n             \u003ci class \u003d\" languagecls \"\u003e  PHP \u003c/i\u003e \n  \u003c/div\u003e\n  \u003c pre class\u003d\"ccontentclss \" \u003e\n\u003ccode\u003e \n  \n \u0026lt;?php  \n \n$dog \u003d new Dog('Fido', 'Brown');\n$dog-\u0026gt;eat(); //  Output: Fido eating...\n$dog-\u0026gt;bark(); //  Output: Fido  barking...\n \n\n ?\u0026gt;  \n  \u003c/code\u003e\u003c/pre\u003e\n\u003c/div\u003e\n    \u003cp\u003eIn this example we create a new DOG object and pass in a name and color to its constructor.We then call its eat() and bark() methods which were inherited from the Animal class and defined in the Dog class respectively.\u003c/p\u003e\n    \u003cp\u003eBy using inheritance we can create new classes that are based on existing classes inheriting their properties and methods and adding new functionality. This allows us to write more efficient and reusable code and makes it easier to organize and maintain our programs\u003c/p\u003e\n    \n  \u003ch4\u003e\u003cli\u003ePolymorphism: \u003c/li\u003e\u003c/h4\u003e\n    \u003cp\u003ePolymorphism is the ability of an object to take on different forms or behaviors. In PHP, polymorphism is achieved through method overriding and method overloading.It is an important concept in Object-Oriented Programming (OOP) that allows objects of different classes to be treated as if they were the same type. This is achieved by using inheritance and method overriding, which allows a subclass to provide its own implementation of a method that is already defined in its parent class. In PHP, polymorphism can be achieved using the extends keyword and the override keyword.\u003c/p\u003e\n    \u003cp\u003eHere example of polymorphism in PHP:\u003c/p\u003e\n    \n \u003cdiv class \u003d\"clsviewer \" \u003e\n  \u003cdiv class \u003d\"clsheader \"\u003e\n             \u003ci class \u003d\" languagecls \"\u003e  PHP \u003c/i\u003e \n  \u003c/div\u003e\n  \u003c pre class\u003d\"ccontentclss \" \u003e\n\u003ccode\u003e \n \n \u0026lt;?php  \n \n class Shape\n {  \n   public function getArea() \n{  \n     return 0;  \n   }  \n }  \n   \n class Circle extends  Shape\n {  \n   private $radius;  \n   \n   public function __construct($radius) \n{  \n     $this-\u0026gt;radius \u003d $radius;  \n }  \n   \n   public function getArea()\n {  \n     return 3.14 * $this-\u0026gt;radius * $this-\u0026gt;radius;  \n               }  \n }  \n   \n class Square extends Shape {  \n   private $length;  \n   \n   public function __construct($length){  \n     $this-\u0026gt;length \u003d $length;  \n                           }  \n   \n   public function getArea() \n{  \n     return $this-\u0026gt;length * $this-\u0026gt;length;     }  \n }  \n\n ?\u0026gt;  \n  \u003c/code\u003e\u003c/pre\u003e\n\u003c/div\u003e\n    \u003cp\u003eIn this example we define a Shape class with a getArea() method that returns 0.We then define two subclasses: Circle and Square, both of which extend the Shape class and provide their own implementation of the getArea() method. \u003c/p\u003e \u003cp\u003e\n\nNote that the getArea() method is defined in the Shape class and overridden in the Circle and Square classes. This allows objects of the Circle and Square classes to be treated as if they were objects of the Shape class because they share the same method signature.\n \u003c/p\u003e \u003cp\u003e\nHere example of how to use the Shape, Circle, and Square classes: \u003c/p\u003e\n   \n \u003cdiv class \u003d\"clsviewer \" \u003e\n  \u003cdiv class \u003d\"clsheader \"\u003e\n             \u003ci class \u003d\" languagecls \"\u003e  PHP \u003c/i\u003e \n  \u003c/div\u003e\n  \u003c pre class\u003d\"ccontentclss \" \u003e\n\u003ccode\u003e \n \n \u0026lt;?php  \n \n  $shapes \u003d array(  \n   new Circle(5),  \n   new Square(4),  \n   new Circle(3)  \n );  \n   \n foreach ($shapes as $shape){  \n   echo \"Area: \" . $shape-\u0026gt;getArea() . \"\u0026lt;br\u0026gt;\";  \n }  \n ?\u0026gt;  \n  \u003c/code\u003e\u003c/pre\u003e\n\u003c/div\u003e\n    \u003cp\u003eIn this example we create an array of Shape objects that contains two Circle objects and one Square object. We then iterate over the array and call the getArea() method on each object which will call the appropriate implementation of the method in each subclass.\u003c/p\u003e\n    \u003cp\u003eBy using polymorphism we can write more flexible and extensible code that can be easily adapted to different situations. This allows us to write code that is more maintainable, reusable and efficient and makes it easier to add new functionality to our programs.\u003c/p\u003e\n    \n    \u003ch4\u003e\u003cli\u003eAbstraction: \u003c/li\u003e\u003c/h4\u003e\n    \u003cp\u003eAbstraction is a mechanism that allows developers to create generalized models of realworld entities / concepts. It helps to reduce complexity and increase the reusability of code.It is an important concept in Object-Oriented Programming (OOP) that allows us to hide the implementation details of a class from its users, while still providing a clear and concise interface for interacting with that class. In PHP we can achieve abstraction by using abstract classes and abstract methods.\u003c/p\u003e\n    \u003cp\u003eHere example of abstraction in PHP:\u003c/p\u003e\n     \n \u003cdiv class \u003d\"clsviewer \" \u003e\n  \u003cdiv class \u003d\"clsheader \"\u003e\n             \u003ci class \u003d\" languagecls \"\u003e  PHP \u003c/i\u003e \n  \u003c/div\u003e\n  \u003c pre class\u003d\"ccontentclss \" \u003e\n\u003ccode\u003e \n \n \u0026lt;?php  \n \n abstract class  Shape {  \n   protected $color;  \n   \n   public function __construct($color)   {  \n     $this-\u0026gt;color \u003d $color;  \n   }  \n   \n   public function getColor() {  \n     return  $this-\u0026gt;color;  \n   }  \n   abstract public function getArea();  \n }  \n \n class Circle extends Shape {  \n   private $radius;  \n   public function __construct($color, $radius)\n {  \n     parent::__construct($color);  \n     $this-\u0026gt;radius \u003d $radius;  \n }  \n   public function getArea() {  \n     return 3.14 * $this-\u0026gt;radius * $this-\u0026gt;radius; \n}  \n }  \n class Square extends Shape {  \n   private   $length;  \n   public function __construct($color, $length) {  \n     parent::__construct($color);  \n     $this-\u0026gt;length \u003d $length;  \n   }     \n   public function getArea() {  \n     return $this-\u0026gt;length * $this-\u0026gt;length;  \n   }  \n }  \n   \n ?\u0026gt;  \n  \u003c/code\u003e\u003c/pre\u003e\n\u003c/div\u003e\n    \u003cp\u003eIn this example we define a Shape class with a getArea() method that returns 0. We then define two subclasses: Circle and Square, both of which extend the Shape class and provide their own implementation of the getArea() method.\n    \u003c/p\u003e\u003cp\u003e\nNote that the getArea() method is defined in the Shape class and overridden in the Circle and Square classes. This allows objects of the Circle and Square classes to be treated as if they were objects of the Shape class because they share the same method signature.\n    \u003c/p\u003e\u003cp\u003e\nHere example of how to use the Shape, Circle and Square classes:\n    \u003c/p\u003e\n    \n   \n \u003cdiv class \u003d\"clsviewer \" \u003e\n  \u003cdiv class \u003d\"clsheader \"\u003e\n             \u003ci class \u003d\" languagecls \"\u003e  PHP \u003c/i\u003e \n  \u003c/div\u003e\n  \u003c pre class\u003d\"ccontentclss \" \u003e\n\u003ccode\u003e \n \n \u0026lt;?php  \n \n$shapes \u003d array(\n    new Circle(5),\n    new Square(4),\n    new Circle(3)\n);\nforeach ($shapes as $shape) {\n    echo \"Area : \" . $shape-\u0026gt;getArea() . \"\u003cbr\u003e\";\n}\n\n ?\u0026gt;  \n  \u003c/code\u003e\u003c/pre\u003e\n\u003c/div\u003e\n  \u003cp\u003e In this example We create an array of Shape objects that contains two Circle objects and one Square object.We then iterate over the array and call the getArea() method on each object which will call the appropriate implementation of the method in each subclass.\n    \u003c/p\u003e\u003cp\u003e\nBy using polymorphism we can write more flexible and extensible code that can be easily adapted to different situations.This allows us to write code that is more maintainable, reusable and efficient and makes it easier to add new functionality to our programs. \u003c/p\u003e\u003c/ol\u003e\n\n\u003ch4\u003eBenefits of OOP in PHP:\u003c/h4\u003e\n\u003col\u003e\u003cli\u003e\u003cp\u003eReusability :OOP in PHP enables developers to write reusable code, which reduces development time and increases efficiency.\u003c/p\u003e\u003c/li\u003e\u003cli\u003e\u003cp\u003e  Modularity: OOP in PHP allows developers to break down complex applications into smaller manageable components.This improves the organization of code and makes it easier to maintain and debug. \u003c/p\u003e\u003c/li\u003e\u003cli\u003e\u003cp\u003e  Extensibility: OOP in PHP promotes the use of inheritance and polymorphism which allows developers to extend the functionality of existing code without modifying the original code.\u003c/p\u003e\u003c/li\u003e \u003cli\u003e\u003cp\u003eSecurity: O O P in PHP enables developers to implement secure coding practices such as encapsulation and data hiding which helps to protect sensitive data from unauthorized access.\u003c/p\u003e\u003c/li\u003e\u003c/ol\u003e\n\n\u003cp\u003eOOP in PHP is a powerful programming paradigm that enables developers to create scalable, efficient and maintainable applications. The essential OOP concepts in PHP including classes and objects, encapsulation, inheritance, polymorphism and abstraction, make it possible to create reusable, modular and secure code. By understanding the benefits of OOP in PHP developers can write better quality code that is easier to maintain and extend.\u003c/p\u003e"},"link":[{"rel":"edit","type":"application/atom+xml","href":"https://www.blogger.com/feeds/4095748245355156272/posts/default/1436035524094031151"},{"rel":"self","type":"application/atom+xml","href":"https://www.blogger.com/feeds/4095748245355156272/posts/default/1436035524094031151"},{"rel":"alternate","type":"text/html","href":"https://www.gettrickz.com/2023/02/object-oriented-programming-in-php.html","title":" Start Learn PHP/MYSQL : How to Do Object Oriented Programming(OOP) in PHP( Easy Explained )"}],"author":[{"name":{"$t":"Juber Khan Baloch"},"uri":{"$t":"https://www.blogger.com/profile/03500557746501068520"},"email":{"$t":"noreply@blogger.com"},"gd$image":{"rel":"http://schemas.google.com/g/2005#thumbnail","width":"35","height":"35","src":"//www.blogger.com/img/blogger_logo_round_35.png"}}],"media$thumbnail":{"xmlns$media":"http://search.yahoo.com/mrss/","url":"https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjbDL56QCWVnfsLzlYPHiit0EwPFYUem83KHaGr_1B9TRWU_AQqpJLUNVAuvz1twgJfzJ_4vYxMsPX7C8sgqNq3SY-_E79jGkDZIFkJnwox5oJwwzKp9B5zWIbyTwuCzx7fvL2YSMMUG23cCAhFWRT4HjXEYmGcAL9x_jJSFuAsh3Y-7hq09CCb1wi02w/s72-c/Object-Oriented-Programming-in-PHP.jpg","height":"72","width":"72"}},{"id":{"$t":"tag:blogger.com,1999:blog-4095748245355156272.post-5611209826186953795"},"published":{"$t":"2023-02-16T17:31:00.009+05:30"},"updated":{"$t":"2023-02-25T00:15:11.279+05:30"},"category":[{"scheme":"http://www.blogger.com/atom/ns#","term":"variables"},{"scheme":"http://www.blogger.com/atom/ns#","term":"MYSQL"},{"scheme":"http://www.blogger.com/atom/ns#","term":"database connectivity"},{"scheme":"http://www.blogger.com/atom/ns#","term":"PHP"},{"scheme":"http://www.blogger.com/atom/ns#","term":"control structures"},{"scheme":"http://www.blogger.com/atom/ns#","term":"Howto"},{"scheme":"http://www.blogger.com/atom/ns#","term":"dynamic content"},{"scheme":"http://www.blogger.com/atom/ns#","term":"operators"},{"scheme":"http://www.blogger.com/atom/ns#","term":"web development"},{"scheme":"http://www.blogger.com/atom/ns#","term":"functions"},{"scheme":"http://www.blogger.com/atom/ns#","term":"programming"},{"scheme":"http://www.blogger.com/atom/ns#","term":"file handling"},{"scheme":"http://www.blogger.com/atom/ns#","term":"data types"},{"scheme":"http://www.blogger.com/atom/ns#","term":"web applications"}],"title":{"type":"text","$t":" Start Learn PHP/MYSQL : How to Do PHP Development and MySQL Database Connectivity A Complete Guide for Beginners"},"content":{"type":"html","$t":"\u003cdiv class\u003d\"separator\" style\u003d\"clear: both; text-align: center;\"\u003e\u003ca href\u003d\"https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEghL5eKZrCu_YChm0F8odjOM92UJVahPJMXZdllX4sDDnnGVzfSU1OAYaQpzI4UadAIXab9A6HXGYvg8-cUKQS4G2btOZ-1b4Al6VHbt-a-ZDxhJCSgDLHT3Ew-C46pgBYyYiNDRgo1oH8TdkGeUzmHKMW64ePpE5l7gi32ZiGShc-E4pd8kQJQsiyz4Q/s1024/A-Comprehensive-Guide-to-the-Basics-of-Web-Development-and-Database-Connectivity-for-Beginners.jpg\" style\u003d\"clear: left; float: left; margin-bottom: 1em; margin-right: 1em;\"\u003e\u003cimg alt\u003d\"A-Comprehensive-Guide-to-the-Basics-of-Web-Development-and-Database-Connectivity-for-Beginners\" border\u003d\"0\" data-original-height\u003d\"683\" data-original-width\u003d\"1024\" height\u003d\"213\" src\u003d\"https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEghL5eKZrCu_YChm0F8odjOM92UJVahPJMXZdllX4sDDnnGVzfSU1OAYaQpzI4UadAIXab9A6HXGYvg8-cUKQS4G2btOZ-1b4Al6VHbt-a-ZDxhJCSgDLHT3Ew-C46pgBYyYiNDRgo1oH8TdkGeUzmHKMW64ePpE5l7gi32ZiGShc-E4pd8kQJQsiyz4Q/w320-h213/A-Comprehensive-Guide-to-the-Basics-of-Web-Development-and-Database-Connectivity-for-Beginners.jpg\" title\u003d\"A-Comprehensive-Guide-to-the-Basics-of-Web-Development-and-Database-Connectivity-for-Beginners\" width\u003d\"320\" /\u003e\u003c/a\u003e\u003c/div\u003e\u003cp\u003e If you are interested in building web applications and working with databases but do not know where to start you have come to the right place. In our previous articles we have covered topics like\u003ca href\u003d\"https://www.gettrickz.com/2020/01/start-learn-phpmysql-start-using-php-in.html\" target\u003d\"_blank\"\u003ePHP and MySQL setup for Windows and Linux OS\u003c/a\u003e. Today we will dive into the basics of \u003ca href\u003d\"https://www.gettrickz.com/2016/04/start-learn-php-what-is-php-how-to.html\" target\u003d\"_blank\"\u003ePHP\u003c/a\u003e. As a powerful and versatile programming language, PHP is widely used for developing dynamic web applications, handling files and connecting to databases.By mastering its fundamentals you can take your web development skills to the next level.\n\u003c/p\u003e\u003cp\u003e\nIn this guide we will focus specifically on the basics of PHP web development and database connectivity. From variables and data types to operators, control structures and functions we will cover everything you need to know to get started with PHP.With real world examples and best practices we will guide you through the process of connecting PHP to a database and working with common database operations like reading, writing and updating data.\u003c/p\u003e\n\u003cp\u003e\nWhether you are a beginner or have some experience with other programming languages this guide will provide a solid foundation for building your skills in PHP and developing your own web applications.So let's Get started and learn the basics of web development and database connectivity in PHP to become a proficient web developer .\u003c/p\u003e\n\u003ch3\u003e\u003cu\u003eHere are some of the basics of PHP:\u003c/u\u003e\u003c/h3\u003e\n\u003col\u003e\u003cli\u003e\u003cb\u003eSyntax:\u003c/b\u003e PHP code is typically embedded within HTML, using opening and closing tags respectively. PHP statements end with a semicolon (;).\n  \u003c/li\u003e\u003cli\u003e\u003cb\u003e\nVariables: \u003c/b\u003eIn PHP you can define variables using the $ symbol, followed by the variable name. For example, $name \u003d \"John\"; assigns the value \"John\" to the variable $name.\n\u003c/li\u003e\u003cli\u003e\u003cb\u003e\nData Types:\u003c/b\u003e PHP has various data types, including strings, integers, floats, booleans, arrays and objects.\n\u003c/li\u003e\u003cli\u003e\u003cb\u003e\nOperators:\u003c/b\u003e PHP has various operators including arithmetic (+, -, *, /, %), assignment (\u003d), comparison (\u003d\u003d, !\u003d, \u0026gt;, \u0026lt;, \u0026gt;\u003d, \u0026lt;\u003d), and logical (\u0026amp;\u0026amp;, ||, !).\n\u003c/li\u003e\u003cli\u003e\u003cb\u003e\nControl Structures:\u003c/b\u003e PHP has various control structures, including if-else statements, switch statements, while and do-while loops ,for loops and foreach loops.\n\u003c/li\u003e\u003cli\u003e\u003cb\u003e\nFunctions:\u003c/b\u003e PHP allows you to define and call functions. Functions are used to perform specific tasks and can be reused throughout your code.\n\u003c/li\u003e\u003cli\u003e\u003cb\u003e\nForms: \u003c/b\u003ePHP is commonly used in web development to process data submitted through HTML forms.\u003c/li\u003e\u003c/ol\u003e\n\u003ch4\u003e1.Syntax:\u003c/h4\u003e\n\u003cp\u003e PHP is a server side scripting language which means that the code is executed on the server before the resulting HTML is sent to the client's browser. PHP code is typically embedded within HTML using opening and closing tags respectively.Here is an example of PHP code that prints \"Hello world!\" to the screen:\u003c/p\u003e\n\u003cdiv class\u003d\" clsviewer \"\u003e\n  \u003cdiv class\u003d\" clsheader \"\u003e\n    \u003ci class\u003d\" languagecls \"\u003ePHP \u003c/i\u003e\n  \u003c/div\u003e\n  \u003cpre class\u003d\" ccontentclss\"\u003e\u003ccode\u003e \u0026lt;!DOCTYPE html\u0026gt;  \n \u0026lt;html\u0026gt;  \n \u0026lt;body\u0026gt;  \n   \n \u0026lt;?php  \n echo \"Hello world!\";  \n ?\u0026gt;  \n   \n \u0026lt;/body\u0026gt;  \n  \u0026lt;/html\u0026gt; \u003c/code\u003e\u003c/pre\u003e\n\u003c/div\u003e\n\n\u003cp\u003eIn Example echo statement is used to print the text  \"Hello world !\"  to the screen. \u003c/p\u003e\u003cp\u003eget started with running PHP code on your PC the first step is to run XAMPP controller .This will allow you to run PHP code on your computer/PC. Once XAMPP is running navigate to the C \u003e xampp \u003e htdocs folder on your PC. In this folder create a new folder called \"test\".Next create a new file in this folder called \"index.php\". You can open this file in a plain text editor like notepad or you can download a more advanced editor like Sublime \u0026 Visual Studio .\n\u003c/p\u003e\u003cp\u003e\nAfter opening the \"index.php\" file in your text editor copy the PHP code from above and paste it into the file. Save the file  close the editor. You re now ready to run your first PHP Code .\n\u003c/p\u003e\u003cp\u003e\nTo do this open your web browser (such as Google Chrome/ Internet Explorer)and enter the following URL in the address bar:\"localhost/test/index.php\". This will run the PHP code and display the message \"Hello world!\" in your web browser .\n\u003c/p\u003e\u003cp\u003e\nCongratulations you have successfully Run your first PHP code on your PC/Computer.With this basic setup you can now begin to learn more about PHP  and Start building your own web applications .\u003c/p\u003e\u003cdiv class\u003d\"separator\" style\u003d\"clear: both; text-align: center;\"\u003e\u003ca href\u003d\"https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEje2kZpIQVl3tB6KvHiam2D4xkDAdBES2_AiVDRvhrsF_CxmcJvzvpIMwIMxhajYiYxoRmoDPNpY6o-s_A0ipE5_1qtULLX9oA0XVitIF7OKyMi_K1EC6G1guxAU0XbtasmBs3Tnxl0amVYAvgcL9XO16e3x9oKGRdlFrKapKe4xLbVytIvDnVWXi-QcQ/s800/hello-world-first-php-code-run.jpg\" style\u003d\"margin-left: 1em; margin-right: 1em;\"\u003e\u003cimg border\u003d\"0\" data-original-height\u003d\"367\" data-original-width\u003d\"800\" height\u003d\"294\" src\u003d\"https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEje2kZpIQVl3tB6KvHiam2D4xkDAdBES2_AiVDRvhrsF_CxmcJvzvpIMwIMxhajYiYxoRmoDPNpY6o-s_A0ipE5_1qtULLX9oA0XVitIF7OKyMi_K1EC6G1guxAU0XbtasmBs3Tnxl0amVYAvgcL9XO16e3x9oKGRdlFrKapKe4xLbVytIvDnVWXi-QcQ/w640-h294/hello-world-first-php-code-run.jpg\" width\u003d\"640\" /\u003e\u003c/a\u003e\u003c/div\u003e\u003cbr /\u003e\u003cdiv class\u003d\"separator\" style\u003d\"clear: both; text-align: center;\"\u003e\u003cbr /\u003e\u003c/div\u003e\n\u003ch4\u003e2.Variables:\u003c/h4\u003e\nIn PHP variables re used to store values.Variables can be assigned a value using the $ symbol followed by the variable name . Example :\n\u003cdiv class\u003d\" clsviewer \"\u003e\n  \u003cdiv class\u003d\" clsheader \"\u003e\n    \u003ci class\u003d\" languagecls \"\u003ePHP \u003c/i\u003e\n  \u003c/div\u003e\n  \u003cpre class\u003d\" ccontentclss\"\u003e\u003ccode\u003e \u0026lt;!DOCTYPE html\u0026gt;  \n \u0026lt;html\u0026gt;  \n \u0026lt;body\u0026gt;  \n   \n \u0026lt;?php  \n $name \u003d \"John\";  \n $age \u003d 30;  \n $height \u003d 1.75;  \n $is_student \u003d true;  \n ?\u0026gt;  \n     \n \u0026lt;?php echo $name; ?\u0026gt;\u0026lt;br\u0026gt;  \n \u0026lt;?php echo $age; ?\u0026gt;\u0026lt;br\u0026gt;  \n \u0026lt;?php echo $height; ?\u0026gt;\u0026lt;br\u0026gt;  \n \u0026lt;?php echo $is_student; ?\u0026gt;  \n   \n  \n \u0026lt;/body\u0026gt;  \n \u0026lt;/html\u0026gt;   \u003c/code\u003e\u003c/pre\u003e\n\u003c/div\u003e\n\u003cp\u003e\nIn this example four variables are defined: $name, $age, $height and $is_student. The variable $name is assigned the value \"John\" $age is assigned the value 30 $height is assigned the value 1.75 and $is_student is assigned the value true. Note that PHP is a loosely typed language, which means that the data type of a variable is determined automatically based on the value assigned to it.\u003c/p\u003e\u003cdiv class\u003d\"separator\" style\u003d\"clear: both; text-align: center;\"\u003e\u003ca href\u003d\"https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhf46ftGq1fkQaP8V_9gb3hRNPOH-55sTojRHcUl-IIL1bGMFomCBe6ewu8Pg0uNeuplnM2OD2DZVEWIBiN7_KVCGROp7ylff3b9P71Sny7OYlO2dFrEZp6Sf49cX43cUCB4FWli6FziC8k5dVBg2EY0OJObDmcT1meNkUZQiFylpqL8EO7gyTSy1oGdQ/s800/learn%20php%20code%20with%20gettrickz.jpg\" style\u003d\"margin-left: 1em; margin-right: 1em;\"\u003e\u003cimg border\u003d\"0\" data-original-height\u003d\"382\" data-original-width\u003d\"800\" height\u003d\"306\" src\u003d\"https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhf46ftGq1fkQaP8V_9gb3hRNPOH-55sTojRHcUl-IIL1bGMFomCBe6ewu8Pg0uNeuplnM2OD2DZVEWIBiN7_KVCGROp7ylff3b9P71Sny7OYlO2dFrEZp6Sf49cX43cUCB4FWli6FziC8k5dVBg2EY0OJObDmcT1meNkUZQiFylpqL8EO7gyTSy1oGdQ/w640-h306/learn%20php%20code%20with%20gettrickz.jpg\" width\u003d\"640\" /\u003e\u003c/a\u003e\u003c/div\u003e\u003cbr /\u003e\u003cp\u003e\u003cbr /\u003e\u003c/p\u003e\n\u003ch4\u003e3.Data Types:\u003c/h4\u003e\n\u003cstrong\u003e\u003cu\u003ePHP has several data types including:\u003c/u\u003e\u003c/strong\u003e\n\u003cul\u003e\u003cli\u003e\nStrings: a sequence of characters enclosed in quotes. Example : \"Hello world!\"\n\u003c/li\u003e\u003cli\u003e\nIntegers: whole numbers without a decimal point. Example: 42\n\u003c/li\u003e\u003cli\u003e\nFloats: numbers with a decimal point. Example: 3.14\n\u003c/li\u003e\u003cli\u003e\nBooleans: true or false. Example: true\n\u003c/li\u003e\u003cli\u003e\nArrays: a collection of values indexed by a key. Example: $colors \u003d array(\"red\", \"green\", \"blue\");\n\u003c/li\u003e\u003cli\u003e\nObjects: a complex data type that represents a realworld object. \u003c/li\u003e\u003c/ul\u003e\n\u003cstrong\u003e\u003cu\u003e\nExample:\u003c/u\u003e\u003c/strong\u003e\n\n\u003cdiv class\u003d\" clsviewer \"\u003e\n  \u003cdiv class\u003d\" clsheader \"\u003e\n    \u003ci class\u003d\" languagecls \"\u003ePHP \u003c/i\u003e\n  \u003c/div\u003e\n  \u003cpre class\u003d\" ccontentclss\"\u003e\u003ccode\u003e \u0026lt;!DOCTYPE html\u0026gt;  \n \u0026lt;html\u0026gt;  \n \u0026lt;body\u0026gt;  \n   \n \u0026lt;?php  \n $name \u003d \" John \";  \n $age \u003d 30;  \n ?\u0026gt;  \n     \n \u0026lt;?php echo \" Hello my name is $name and I m $age years old . \"; ?\u0026gt;  \n   \n   \n   \n \u0026lt;/body\u0026gt;  \n \u0026lt;/html\u0026gt;  \u003c/code\u003e\u003c/pre\u003e\n\u003c/div\u003e\u003cp\u003eIn the above code , we define two variables using PHP.$name is a string datatype and is assigned the value \"John\" while $age is an integer datatype and is assigned the value 30. Using the echo statement we print a greeting to the screen that includes the values of these variables. The output of the code will be \"Hello , my name is John and I am 30 years old\". This simple example demonstrates how to define variables and output their values using PHP.\u003c/p\u003e\n\u003ch4\u003e4.Operators:\u003c/h4\u003e\n\n\u003cstrong\u003e\u003cu\u003ePHP has several operators  including:\u003c/u\u003e\u003c/strong\u003e\n\u003cp\u003e\u003cstrong\u003e1.Arithmetic operators:\u003c/strong\u003e used to perform mathematical operations , such as addition (+), subtraction (-), multiplication (*), division (/) and modulus (%) .\u003c/p\u003e\n\u003cdiv class\u003d\" clsviewer \"\u003e\n  \u003cdiv class\u003d\" clsheader \"\u003e\n    \u003ci class\u003d\" languagecls \"\u003ePHP \u003c/i\u003e\n  \u003c/div\u003e\n  \u003cpre  class\u003d\" ccontentclss\"\u003e\u003ccode\u003e  \u0026lt;!DOCTYPE html\u0026gt;  \n \u0026lt;html\u0026gt;  \n \u0026lt;body\u0026gt;  \n \u0026lt;?php  \n $x \u003d 10;  \n $y \u003d 3;  \n echo $x + $y;    //Outputs 13  \n echo $x - $y; // Outputs 7  \n echo $x * $y; //Outputs 30  \n echo $x / $y; // Outputs 3.3333333333333  \n echo $x % $y; // Outputs 1  \n ?\u0026gt;  \n   \n   \n   \n \n \u0026lt;/body\u0026gt;  \n \u0026lt;/html\u0026gt;  \u003c/code\u003e\u003c/pre\u003e\n\u003c/div\u003e\n\u003cp\u003e\u003cstrong\u003e2.Assignment operators :\u003c/strong\u003e used to assign a value to a variable . Example:\u003c/p\u003e\n\u003cdiv class\u003d\" clsviewer \"\u003e\n  \u003cdiv class\u003d\" clsheader \"\u003e\n    \u003ci class\u003d\" languagecls \"\u003ePHP \u003c/i\u003e\n  \u003c/div\u003e\n  \u003cpre  class\u003d\" ccontentclss\"\u003e\u003ccode\u003e  \u0026lt;!DOCTYPE html\u0026gt;  \n \u0026lt;html\u0026gt;  \n \u0026lt;body\u0026gt;  \n   \n \u0026lt;?php  \n $x \u003d 10;\n $y \u003d 3;\n $x +\u003d $y;  // equivalent to  $x \u003d $x + $y;\n $x -\u003d $y;   //  equivalent to $x \u003d $x - $y;\n $x *\u003d $y; // equivalent to $x \u003d $x * $y;\n $x /\u003d $y; //  equivalent to $x \u003d $x / $y;\n $x %\u003d $y; // equivalent to $x \u003d $x % $y;\n ?\u0026gt;  \n   \n   \n   \n   \n \u0026lt;/body\u0026gt;  \n \u0026lt;/html\u0026gt;  \u003c/code\u003e\u003c/pre\u003e\n\u003c/div\u003e\n\u003cp\u003e\u003cstrong\u003e3.Comparison operators :\u003c/strong\u003e used to compare two values . Example:\u003c/p\u003e\n\u003cdiv class\u003d\" clsviewer \"\u003e\n  \u003cdiv class\u003d\" clsheader \"\u003e\n    \u003ci class\u003d\" languagecls \"\u003ePHP \u003c/i\u003e\n  \u003c/div\u003e\n  \u003cpre class\u003d\" ccontentclss\"\u003e\u003ccode\u003e  \u0026lt;!DOCTYPE html\u0026gt;  \n \u0026lt;html\u0026gt;  \n \u0026lt;body\u0026gt;  \n   \n \u0026lt;?php  \n  $x \u003d 10;  \n  $y \u003d 3;  \n  var_dump($x \u003d\u003d $y); // Outputs bool(false)  \n  var_dump($x !\u003d $y); // Outputs bool(true)  \n  var_dump($x \u0026gt; $y); // Outputs bool(true)  \n  var_dump($x \u0026lt; $y); // Outputs bool(false)  \n  var_dump($x \u0026gt;\u003d $y); // Outputs bool(true)  \n  var_dump($x \u0026lt;\u003d $y); // Outputs bool(false)  \n ?\u0026gt;  \n   \n   \n   \n   \n \u0026lt;/body\u0026gt;  \n \u0026lt;/html\u0026gt;  \u003c/code\u003e\u003c/pre\u003e\n\u003c/div\u003e\n\u003cp\u003e\u003cstrong\u003e4.Logical operators :\u003c/strong\u003e used to combine two or more conditions . Example:\u003c/p\u003e\n\u003cdiv class\u003d\" clsviewer \"\u003e\n  \u003cdiv class\u003d\" clsheader \"\u003e\n    \u003ci class\u003d\" languagecls \"\u003ePHP \u003c/i\u003e\n  \u003c/div\u003e\n  \u003cpre class\u003d\" ccontentclss\"\u003e\u003ccode\u003e  \u0026lt;!DOCTYPE html\u0026gt;  \n \u0026lt;html\u0026gt;  \n \u0026lt;body\u0026gt;  \n   \n \u0026lt;?php  \n  $x \u003d 10;  \n $y \u003d 3;  \n $z \u003d 5;  \n var_dump($x \u0026gt; $y \u0026amp;\u0026amp; $x \u0026gt; $z); // Outputs bool(true)  \n var_dump($x \u0026gt; $y || $x \u0026lt; $z); // Outputs bool(true)  \n var_dump(!($x \u0026gt; $y)); // Outputs bool(false)   \n ?\u0026gt;  \n   \n   \n   \n   \n \u0026lt;/body\u0026gt;  \n \u0026lt;/html\u0026gt;  \u003c/code\u003e\u003c/pre\u003e\n\u003c/div\u003e\n\u003ch3\u003e5.Control Structures:\u003c/h3\u003e\n\u003cstrong\u003e\u003cu\u003e\nControl Structures In PHP  re Used to execute code based on certain conditions . \u003c/u\u003e\u003c/strong\u003e\n\u003cp\u003e\u003cstrong\u003eIf-else statements :\u003c/strong\u003e used to execute code if a certain condition is true or execute a different code if the condition is false. Example:\u003c/p\u003e\n\u003cdiv class\u003d\" clsviewer \"\u003e\n  \u003cdiv class\u003d\" clsheader \"\u003e\n    \u003ci class\u003d\" languagecls \"\u003ePHP \u003c/i\u003e\n  \u003c/div\u003e\n  \u003cpre class\u003d\" ccontentclss\"\u003e\u003ccode\u003e  \u0026lt;!DOCTYPE html\u0026gt;  \n \u0026lt;html\u0026gt;  \n \u0026lt;body\u0026gt;  \n   \n \u0026lt;?php  \n $x \u003d 10;\n$y \u003d 3;\nif ($x \u0026gt; $y) {\n  echo \"x is greater than y\";\n} else {\n  echo \"x is less than or equal to y\";\n}  \n\u003ci\u003e//Outputs x is greater than y\u003c/i\u003e\n ?\u0026gt;  \n   \n   \n   \n   \n \u0026lt;/body\u0026gt;  \n \u0026lt;/html\u0026gt;  \u003c/code\u003e\u003c/pre\u003e\n\u003c/div\u003e\n\n\u003cp\u003e\u003cstrong\u003eSwitch statements :\u003c/strong\u003e used to execute different code blocks based on the value of a variable . Example:\u003c/p\u003e\n\u003cdiv class\u003d\" clsviewer \"\u003e\n  \u003cdiv class\u003d\" clsheader \"\u003e\n    \u003ci class\u003d\" languagecls \"\u003ePHP \u003c/i\u003e\n  \u003c/div\u003e\n  \u003cpre class\u003d\" ccontentclss\"\u003e\u003ccode\u003e  \u0026lt;!DOCTYPE html\u0026gt;  \n \u0026lt;html\u0026gt;  \n \u0026lt;body\u0026gt;  \n   \n \u0026lt;?php  \n$day \u003d \"Monday\";\nswitch ($day) {\n  case \"Monday\":\n    echo \"Today is monday\";\n    break;\n  case \"Tuesday\":\n    echo \"Today is tuesday\";\n    break;\n  case \"Wednesday\":\n    echo \"Today is wednesday\";\n    break;\n  default:\n    echo \"Today is not monday, tuesday or wednesday\";\n} \n\u003ci\u003e//Outputs Today is monday\u003c/i\u003e\n ?\u0026gt;  \n   \n   \n   \n   \n \u0026lt;/body\u0026gt;  \n \u0026lt;/html\u0026gt;  \u003c/code\u003e\u003c/pre\u003e\n\u003c/div\u003e\n\u003cp\u003e\u003cstrong\u003eLoops:\u003c/strong\u003e used to execute a block of code multiple times . Here are some examples:\u003c/p\u003e\n\u003cdiv class\u003d\" clsviewer \"\u003e\n  \u003cdiv class\u003d\" clsheader \"\u003e\n    \u003ci class\u003d\" languagecls \"\u003ePHP \u003c/i\u003e\n  \u003c/div\u003e\n  \u003cpre class\u003d\" ccontentclss\"\u003e\u003ccode\u003e  \u0026lt;!DOCTYPE html\u0026gt;  \n \u0026lt;html\u0026gt;  \n \u0026lt;body\u0026gt;  \n   \n\u0026lt;?php  \n // While loop  \n $i \u003d 1;  \n while ($i \u0026lt;\u003d 10) {  \n  echo $i;  \n  $i++;  \n }  \n ?\u0026gt;  \u003ci\u003e//Outputs 12345678910\u003c/i\u003e\n \u0026lt;br\u0026gt; \u0026lt;?php  \n // Do-while loop  \n $i \u003d 1;  \n do {  \n  echo $i;  \n  $i++;  \n } while ($i \u0026lt;\u003d 10);  \n   \n // For loop  \n for ($i \u003d 1; $i \u0026lt;\u003d 10; $i++) {  \n  echo $i;  \n }  \n ?\u0026gt;  \u003ci\u003e//Outputs 1234567891012345678910\u003c/i\u003e\n \u0026lt;br\u0026gt;\u0026lt;?php  \n // Foreach loop (used to loop through arrays)  \n $colors \u003d array(\"Red\", \"Green\", \"Blue\");  \n foreach ($colors as $color) {  \n  echo $color;  \n }  \n ?\u0026gt;  \u003ci\u003e//Outputs RedGreenBlue\u003c/i\u003e\n    \n\n\n   \n   \n   \n   \n \u0026lt;/body\u0026gt;  \n \u0026lt;/html\u0026gt;  \u003c/code\u003e\u003c/pre\u003e\n\u003c/div\u003e\n\n\u003ch3\u003e6.Functions:\u003c/h3\u003e\n\u003cp\u003e\nFunctions in PHP are used to perform specific tasks and can be reused throughout your code. Here 's an example of a function that calculates the sum of two numbers :\u003c/p\u003e\n\n\u003cdiv class\u003d\" clsviewer \"\u003e\n  \u003cdiv class\u003d\" clsheader \"\u003e\n    \u003ci class\u003d\" languagecls \"\u003ePHP \u003c/i\u003e\n  \u003c/div\u003e\n  \u003cpre class\u003d\" ccontentclss\"\u003e\u003ccode\u003e  \u0026lt;!DOCTYPE html\u0026gt;  \n \u0026lt;html\u0026gt;  \n \u0026lt;body\u0026gt;  \n   \n \u0026lt;?php  \nfunction sum($x, $y) {\n  $result \u003d $x + $y;\n  return $result;\n}\n\necho sum(2, 3); \n\n ?\u0026gt;  \u003ci\u003e// Outputs 5\u003c/i\u003e\n   \n   \n   \n   \n \u0026lt;/body\u0026gt;  \n \u0026lt;/html\u0026gt;  \u003c/code\u003e\u003c/pre\u003e\n\u003c/div\u003e\n\u003cp\u003eIn this example a function called 'sum ' is defined that takes two parameters $x and $y calculates their sum and returns the result using the return statement. The function is then called with the arguments 2 and 3 and the result is printed using the echo statement.\n\u003c/p\u003e\u003cp\u003e\nFunctions can also have default parameter values which are used if no value is passed in for that parameter:\u003c/p\u003e\n\n\u003cdiv class\u003d\" clsviewer \"\u003e\n  \u003cdiv class\u003d\" clsheader \"\u003e\n    \u003ci class\u003d\" languagecls \"\u003ePHP \u003c/i\u003e\n  \u003c/div\u003e\n  \u003cpre class\u003d\" ccontentclss\"\u003e\u003ccode\u003e \u0026lt;!DOCTYPE html\u0026gt;  \n \u0026lt;html\u0026gt;  \n \u0026lt;body\u0026gt;  \n   \n \u0026lt;?php  \nfunction sayHello($name \u003d \"World\") {\n  echo \"Hello, $name!\";\n}\n\nsayHello(); \nsayHello(\"John\"); \n\n ?\u0026gt;  \u003ci\u003e// Outputs \"Hello World!\"\u003c/i\u003e \n \u003ci\u003e// Outputs \"Hello John!\" \u003c/i\u003e\n   \n   \n   \n   \n \u0026lt;/body\u0026gt;  \n \u0026lt;/html\u0026gt;  \u003c/code\u003e\u003c/pre\u003e\n\u003c/div\u003e\u003cp\u003eIn this example a function called sayHello is defined that takes an optional parameter $name with a default value of \"World\" . If a value is passed in for $name that value is used , otherwise the default value is used. The function is then called twice once with no argument and once with the argument \"John\" , and the output is printed using the echo statement.\u003c/p\u003e\n\n\u003ch3\u003e7.Arrays:\u003c/h3\u003e\u003cp\u003e\nArrays in PHP are used to store multiple values in a single variable. Here 's an example of an array:\u003c/p\u003e\n\u003cdiv class\u003d\" clsviewer \"\u003e\n  \u003cdiv class\u003d\" clsheader \"\u003e\n    \u003ci class\u003d\" languagecls \"\u003ePHP \u003c/i\u003e\n  \u003c/div\u003e\n  \u003cpre class\u003d\" ccontentclss\"\u003e\u003ccode\u003e  \u0026lt;!DOCTYPE html\u0026gt;  \n \u0026lt;html\u0026gt;  \n \u0026lt;body\u0026gt;  \n   \n \u0026lt;?php  \n$colors \u003d array(\"red\", \"green\", \"blue\");\necho $colors[0]; // Outputs \"red\"\necho $colors[1]; // Outputs \"green\"\necho $colors[2]; // Outputs \"blue\"\n\n ?\u0026gt;  \n   \n   \n   \n   \n \u0026lt;/body\u0026gt;  \n \u0026lt;/html\u0026gt;  \u003c/code\u003e\u003c/pre\u003e\n\u003c/div\u003e\n\u003cp\u003eIn this example an array called $colors is defined that contains three elements . The elements are accessed using their index , which starts at 0.\u003c/p\u003e\n\u003cp\u003e\n  Arrays can also be created using the array function :\u003c/p\u003e\n\u003cdiv class\u003d\" clsviewer \"\u003e\n  \u003cdiv class\u003d\" clsheader \"\u003e\n    \u003ci class\u003d\" languagecls \"\u003ePHP \u003c/i\u003e\n  \u003c/div\u003e\n  \u003cpre class\u003d\" ccontentclss\"\u003e\u003ccode\u003e  \u0026lt;!DOCTYPE html\u0026gt;  \n \u0026lt;html\u0026gt;  \n \u0026lt;body\u0026gt;  \n   \n \u0026lt;?php  \n$ages \u003d array(\"Peter\" \u003d\u0026gt; 32, \"John\" \u003d\u0026gt; 28, \"Mary\" \u003d\u0026gt; 45);\necho $ages[\"John\"]; // Outputs 28\n\n ?\u0026gt;  \n   \n   \n   \n   \n \u0026lt;/body\u0026gt;  \n \u0026lt;/html\u0026gt;  \u003c/code\u003e\u003c/pre\u003e\n\u003c/div\u003e\u003cp\u003e\nIn this example an array called $ages is defined using key-value pairs . The elements are accessed using their key which is a string .\n\u003c/p\u003e\u003cp\u003e\n  Arrays can be looped through using the foreach loop :\u003c/p\u003e\n\u003cdiv class\u003d\" clsviewer \"\u003e\n  \u003cdiv class\u003d\" clsheader \"\u003e\n    \u003ci class\u003d\" languagecls \"\u003ePHP \u003c/i\u003e\n  \u003c/div\u003e\n  \u003cpre class\u003d\" ccontentclss\"\u003e\u003ccode\u003e  \u0026lt;!DOCTYPE html\u0026gt;  \n \u0026lt;html\u0026gt;  \n \u0026lt;body\u0026gt;  \n   \n \u0026lt;?php  \n$colors \u003d array(\"red\", \"green\", \"blue\");\nforeach ($colors as $color) {\n  echo $color;\n}\n// Outputs RedGreenBlue\n ?\u0026gt;  \n   \n   \n   \n   \n \u0026lt;/body\u0026gt;  \n \u0026lt;/html\u0026gt;  \u003c/code\u003e\u003c/pre\u003e\n\u003c/div\u003e\n\u003cp\u003eIn this example the array $colors is looped through using the foreach loop and each element is printed using the echo statement.\u003c/p\u003e\n\n\u003ch3\u003e8.File Handling:\u003c/h3\u003e\n\u003cp\u003eFile handling in PHP is used to read and write files on a server . The fopen function is used to open a file and returns a file pointer that is used to access the file. Here 's an example of reading a file: Create a new file and name it \"example.txt\".Type \"Hello World My name is Jhon\" into the file and save the file . \u003c/p\u003e\n\u003cdiv class\u003d\" clsviewer \"\u003e\n  \u003cdiv class\u003d\" clsheader \"\u003e\n    \u003ci class\u003d\" languagecls \"\u003ePHP \u003c/i\u003e\n  \u003c/div\u003e\n  \u003cpre class\u003d\" ccontentclss\"\u003e\u003ccode\u003e  \u0026lt;!DOCTYPE html\u0026gt;  \n \u0026lt;html\u0026gt;  \n \u0026lt;body\u0026gt;  \n   \n \u0026lt;?php  \n$file \u003d fopen(\"example.txt\", \"r\");\nif ($file) {\n  while (($line \u003d fgets($file)) !\u003d\u003d false) {\n    echo $line;\n  }\n  fclose($file);\n}\n// Outputs Hello World My name  is Jhon\n ?\u0026gt;  \n   \n   \n   \n   \n \u0026lt;/body\u0026gt;  \n \u0026lt;/html\u0026gt;  \u003c/code\u003e\u003c/pre\u003e\n\u003c/div\u003e\u003cp\u003e\n \nIn this example  the fopen function is used to open a file called example.txt in read mode . The while loop is used to read each line of the file using the fgets function and output it using the echo statement. Finally the fclose function is used to close the file .\n\u003c/p\u003e\u003cp\u003e\u003c/p\u003e\u003cp\u003e\n  writing to a file is also possible Using the  fopen function in write mode :\u003c/p\u003e\n\u003cdiv class\u003d\" clsviewer \"\u003e\n  \u003cdiv class\u003d\" clsheader \"\u003e\n    \u003ci class\u003d\" languagecls \"\u003ePHP \u003c/i\u003e\n  \u003c/div\u003e\n  \u003cpre class\u003d\" ccontentclss\"\u003e\u003ccode\u003e  \u0026lt;!DOCTYPE html\u0026gt;  \n \u0026lt;html\u0026gt;  \n \u0026lt;body\u0026gt;  \n   \n \u0026lt;?php  \n$file \u003d fopen(\"example.txt\", \"w\");\nfwrite($file, \"Hello World!\");\nfclose($file);\n ?\u0026gt;  \n   \n   \n   \n   \n \u0026lt;/body\u0026gt;  \n \u0026lt;/html\u0026gt;  \u003c/code\u003e\u003c/pre\u003e\n\u003c/div\u003e\n\u003cp\u003e\nIn this example, the fopen function is used to open a file called example.txt in write mode. The fwrite function is used to write the string \"Hello World!\" to the file, and the fclose function is used to close the file.\u003c/p\u003e\n\u003ch3\u003e9. Database Connectivity:\u003c/h3\u003e\n\u003cp\u003ePHP is often used for web development, and it 's common to interact with databases to store and retrieve data. PHP provides several extensions to interact with databases including MySQL and PostgreSQL.\n\u003c/p\u003e\u003cp\u003eIn a previous post about\u003ca href\u003d\"https://www.gettrickz.com/2016/05/start-learn-phpmysql-what-is-mysql-why.html\" target\u003d\"_blank\"\u003e MySQL\u003c/a\u003e, we discussed how to create a database and table. In this post we will provide a summary of those steps and explain how to create a database using phpMyAdmin .\u003c/p\u003e\u003cp\u003eIn this post we will explain how to create a database using phpMyAdmin which is a popular webbased tool for managing MySQL databases. With phpMyAdmin you can easily create and manage databases , tables and other database objects.\u003c/p\u003e\u003cp\u003eYou can create a new database by following these Steps:\u003c/p\u003e\u003col\u003e\u003cli\u003eClick on the \"New\" button in the left hand navigation menu to create a new database.\u003c/li\u003e\u003cli\u003eEnter a name for your database in the \"Create database\" form.You can choose any name you like but it ' s a good idea to choose something descriptive and easy to remember.\u003c/li\u003e\u003cli\u003eSelect the default collation for your database. This specifies the character set and sorting order that should be used for text data in your database. In most cases , you can leave this set to the default value of \"utf8_general_ci\".\u003c/li\u003e\u003cli\u003eClick the \"Create\"  button to create your new database.\u003c/li\u003e\u003c/ol\u003e\u003cp\u003eOnce you have created your database , you can start creating tables by following these steps:\u003c/p\u003e\u003col\u003e\u003cli\u003eClick on the name of the database you just created to enter it.\u003c/li\u003e\u003cli\u003eClick on the \"New\" button in the left  hand navigation menu to create a new table.\u003c/li\u003e\n  \u003cli\u003eEnter a name for your table in the \"Create table\" form. Again , it 's a good idea to choose a descriptive name that reflects the purpose of your table.\u003c/li\u003e\u003cli\u003eEnter the number of Columns you want your table to have.Each column represents a different Type of data that you want to store in the table.\u003c/li\u003e\u003cli\u003eFor each column, enter a name and select a data type. The data type determines the kind of data that can be stored in the column. For example , you might use an \"int\" data type for numeric values or a \"varchar\" data type for text strings.\u003c/li\u003e\u003cli\u003eYou can also specify additional options for each column, such as whether it should be a primary key (which uniquely identifies each row in the table), or whether it should have a default value or be set to auto-increment.\u003c/li\u003e\u003cli\u003eOnce you have defined all of your columns and their options, click the \"Save\" button to create your new table.\u003c/li\u003e\u003c/ol\u003e\u003cp\u003eThat's it! You have now created a new database and table using phpMyAdmin. From here, you can start populating your table with data, running queries and managing your database in a variety of other ways.\u003c/p\u003e\n\u003cp\u003eTo create a table named \"users\" with three columns - \"id\", \"name\" and \"email\" - using phpMyAdmin, you can follow these steps:\u003c/p\u003e\n\u003col\u003e\u003cli\u003e\u003cp\u003eOpen phpMyAdmin and select the database where you want to create the \"users\" table.You can select the database by clicking on its name in the left-hand sidebar.\u003c/p\u003e\u003c/li\u003e\u003cli\u003e\u003cp\u003eClick on the \"Structure\" tab at the top of the page to create a new table.\u003c/p\u003e\u003c/li\u003e\u003cli\u003e\u003cp\u003eIn the \"Create table\" section, enter \"users\" in the \"Table name\" field.\u003c/p\u003e\u003c/li\u003e\u003cli\u003e\u003cp\u003eUnder \"Number of columns\" , enter \"3\".\u003c/p\u003e\u003c/li\u003e\u003cli\u003e\u003cp\u003eIn the first row of the \"Column name\" column, enter \"id\".\u003c/p\u003e\u003c/li\u003e\u003cli\u003e\u003cp\u003eIn the \"Type\" column for the \"id\" column select \"INT\" for integer.\u003c/p\u003e\u003c/li\u003e\u003cli\u003e\u003cp\u003eCheck the \"A.I.\" (Auto Increment) checkbox to make the \"id\" column an autoincrementing field.\u003c/p\u003e\u003c/li\u003e\u003cli\u003e\u003cp\u003eIn the \"Attributes\" section for the \"id\" column, select \"Primary\" to make it the primary key of the table.\u003c/p\u003e\u003c/li\u003e\u003cli\u003e\u003cp\u003eRepeat steps 5-8 for the \"name\" and \"email\" columns.\u003c/p\u003e\u003c/li\u003e\u003cli\u003e\u003cp\u003eClick on the \"Save\" button at the bottom of the page to create the \"users\" table with the specified columns.\u003c/p\u003e\u003c/li\u003e\u003c/ol\u003e\u003cp\u003eThat 's it! You have now successfully created a new table named \"users\" with three columns using phpMyAdmin. You can now start populating the table with data by using the \"Insert\" tab in phpMyAdmin or by using SQL statements to insert data directly into the table.\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003eInsert query\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003eTo insert data into the \"users\" table using SQL queries in PHP You can use The following code :\u003c/p\u003e\n\u003cdiv class\u003d\" clsviewer \"\u003e\n  \u003cdiv class\u003d\" clsheader \"\u003e\n    \u003ci class\u003d\" languagecls \"\u003ePHP \u003c/i\u003e\n  \u003c/div\u003e\n  \u003cpre class\u003d\" ccontentclss\"\u003e\u003ccode\u003e  \u0026lt;!DOCTYPE html\u0026gt;  \n \u0026lt;html\u0026gt;  \n \u0026lt;body\u0026gt;  \n   \n \u0026lt;?php  \n $servername \u003d \"localhost\";  \n $username \u003d \"username\";  \n $password \u003d \"\";  \n $dbname \u003d \"myDataB\";  \n   \n // Create connection  \n $conn \u003d new mysqli($servername, $username, $password, $dbname);  \n   \n // Check connection  \n if ($conn-\u0026gt;connect_error) {  \n  die(\"Connection failed: \" . $conn-\u0026gt;connect_error);  \n }  \n   \n// Insert data into the table\n$sql \u003d \"INSERT INTO users (name, email) VALUES ('John', 'john@example.com')\";\nif ($conn-\u0026gt;query($sql) \u003d\u003d\u003d TRUE) {\n    echo \"New record created successfully\";\n} else {\n    echo \"Error: \" . $sql . \"\u003cbr /\u003e\" . $conn-\u0026gt;error;\n}\n   \n // Close connection  \n $conn-\u0026gt;close();  \n ?\u0026gt;    \n   \n   \n   \u003ci\u003e//Outputs new record created successfully\u003c/i\u003e\n   \n \u0026lt;/body\u0026gt;  \n \u0026lt;/html\u0026gt;  \u003c/code\u003e\u003c/pre\u003e\n\u003c/div\u003e\n\u003cp\u003eThis  code creates a new connection to your MySQL database using the connection variables (servername, username, password, dbname), and then inserts a new record into the \"users\" table with the values \"John \" for the \"name\" column and \"john@example.com\" for the \"email\" column.\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003eSELECT query\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\n  Here 's an example of connecting to a MySQL database and executing a query:\u003c/p\u003e\n\u003cdiv class\u003d\" clsviewer \"\u003e\n  \u003cdiv class\u003d\" clsheader \"\u003e\n    \u003ci class\u003d\" languagecls \"\u003ePHP \u003c/i\u003e\n  \u003c/div\u003e\n  \u003cpre class\u003d\" ccontentclss\"\u003e\u003ccode\u003e  \u0026lt;!DOCTYPE html\u0026gt;  \n \u0026lt;html\u0026gt;  \n \u0026lt;body\u0026gt;  \n   \n \u0026lt;?php  \n $servername \u003d \"localhost\";  \n $username \u003d \"username\";  \n $password \u003d \"\";  \n $dbname \u003d \"myDataB\";  \n   \n // Create connection  \n $conn \u003d new mysqli($servername, $username, $password, $dbname);  \n   \n // Check connection  \n if ($conn-\u0026gt;connect_error) {  \n  die(\"Connection failed: \" . $conn-\u0026gt;connect_error);  \n }  \n   \n // Execute query  \n $sql \u003d \"SELECT * FROM users\";  \n $result \u003d $conn-\u0026gt;query($sql);  \n   \n // Output results  \n if ($result-\u0026gt;num_rows \u0026gt; 0) {  \n  while ($row \u003d $result-\u0026gt;fetch_assoc()) {  \n   echo \"Name: \" . $row[\"name\"] . \" - Email: \" . $row[\"email\"];  \n  }  \n } else {  \n  echo \"0 results\";  \n }  \n   \n // Close connection  \n $conn-\u0026gt;close();  \n ?\u0026gt;    \n   \n     \u003ci\u003e//Outputs Name: John - Email: john@example.com\u003c/i\u003e\n   \n   \n \u0026lt;/body\u0026gt;  \n \u0026lt;/html\u0026gt;  \u003c/code\u003e\u003c/pre\u003e\n\u003c/div\u003e\n\u003cp\u003eIn this Example, a connection to a MySQL database is established using the mysqli extension. The connect_error property is used to check if the connection was successful.The query method is used to execute a SQL query, and the fetch_assoc method is used to retrieve each row of the result set. Finally , the close method is used to Close the connection.\u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003eUPDATE query\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003eTo update an existing record in the \"users\" table using an SQL query in PHP  you can use the following code as an example:\u003c/p\u003e\n\u003cdiv class\u003d\" clsviewer \"\u003e\n  \u003cdiv class\u003d\" clsheader \"\u003e\n    \u003ci class\u003d\" languagecls \"\u003ePHP \u003c/i\u003e\n  \u003c/div\u003e\n  \u003cpre class\u003d\" ccontentclss\"\u003e\u003ccode\u003e  \u0026lt;!DOCTYPE html\u0026gt;  \n \u0026lt;html\u0026gt;  \n \u0026lt;body\u0026gt;  \n   \n \u0026lt;?php  \n $servername \u003d \"localhost\";  \n $username \u003d \"username\";  \n $password \u003d \"\";  \n $dbname \u003d \"myDataB\";  \n   \n // Create connection  \n $conn \u003d new mysqli($servername, $username, $password, $dbname);  \n   \n // Check connection  \n if ($conn-\u0026gt;connect_error) {  \n  die(\"Connection failed: \" . $conn-\u0026gt;connect_error);  \n }  \n   \n // Update record in the table\n$sql \u003d \"UPDATE users SET name\u003d'Jane Ross', email\u003d'jane.ross@example.com' WHERE id\u003d1\";\nif ($conn-\u0026gt;query($sql) \u003d\u003d\u003d TRUE) {\n    echo \"Record updated successfully\";\n} else {\n    echo \"Error updating record: \" . $conn-\u0026gt;error;\n}\n   \n // Close connection  \n $conn-\u0026gt;close();  \n ?\u0026gt;    \n   \n     \u003ci\u003e//Outputs record updated successfully\u003c/i\u003e\n   \n   \n \u0026lt;/body\u0026gt;  \n \u0026lt;/html\u0026gt;  \u003c/code\u003e\u003c/pre\u003e\n\u003c/div\u003e\n\u003cp\u003eIn this Example , the code connects to the MySQL database using the connection variables (servername, username, password , dbname)  and then updates the record with an \"id\" value of 1 in the \"users\" table to set the \"name\" to \"Jane Ross\" and The \"email\" to \"jane.ross@example.com\" .\n\u003c/p\u003e\u003cp\u003e\nYou can modify the sql query to update different records in the table with different values.You can use various SQL operators and conditions to specify which records you want to update. For Example , you can use the WHERE clause to Specify a condition that must be met for the record to be updated .\u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003eDELETE query\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003eTo delete a record from the \"users\" table using an SQL query in PHP  you can use the following code as an example :\u003c/p\u003e\n\u003cdiv class\u003d\" clsviewer \"\u003e\n  \u003cdiv class\u003d\" clsheader \"\u003e\n    \u003ci class\u003d\" languagecls \"\u003ePHP \u003c/i\u003e\n  \u003c/div\u003e\n  \u003cpre class\u003d\" ccontentclss\"\u003e\u003ccode\u003e  \u0026lt;!DOCTYPE html\u0026gt;  \n \u0026lt;html\u0026gt;  \n \u0026lt;body\u0026gt;  \n   \n \u0026lt;?php  \n $servername \u003d \"localhost\";  \n $username \u003d \"username\";  \n $password \u003d \"\";  \n $dbname \u003d \"myDataB\";  \n   \n // Create connection  \n $conn \u003d new mysqli($servername, $username, $password, $dbname);  \n   \n // Check connection  \n if ($conn-\u0026gt;connect_error) {  \n  die(\"Connection failed: \" . $conn-\u0026gt;connect_error);  \n }  \n   \n // Delete record from the table\n$sql \u003d \"DELETE FROM users WHERE id\u003d1\";\nif ($conn-\u0026gt;query($sql) \u003d\u003d\u003d TRUE) {\n    echo \"Record deleted successfully\";\n} else {\n    echo \"Error deleting record: \" . $conn-\u0026gt;error;\n}\n // Close connection  \n $conn-\u0026gt;close();  \n ?\u0026gt;    \n   \n     \u003ci\u003e//Outputs record deleted successfully\u003c/i\u003e\n   \n   \n \u0026lt;/body\u0026gt;  \n \u0026lt;/html\u0026gt;  \u003c/code\u003e\u003c/pre\u003e\n\u003c/div\u003e\n\u003cp\u003eIn this Example , the code connects to the MySQL database using the connection variables (servername, username, password , dbname), and then deletes the record with an \"id\" value of 1 from the \"users\" table.\n\u003c/p\u003e\u003cp\u003e\nYou can modify the SQL query to delete different records from the table based on different conditions. For example  you can use the WHERE clause to specify a condition that must be met for the record to be deleted .\u003c/p\u003e\n\n\u003cp\u003e\nPHP is a versatile programming language used for web development, file handling and database connectivity. With a solid understanding of the basics covered in this article, you'll be well on your way to building web applications and working with databases in PHP.The next post promises to be an exciting one as we delve into the world of object-oriented programming (OOP) in PHP. With this , you can expect to gain a deeper understanding of PHP and MySQL and be better equipped to develop small applications. OOP is an essential programming concept that makes code more organized, easier to maintain, and helps reduce errors. So be sure to tune in for the next post to enhance your PHP development skills and take your coding abilities to the next level.\u003c/p\u003e"},"link":[{"rel":"edit","type":"application/atom+xml","href":"https://www.blogger.com/feeds/4095748245355156272/posts/default/5611209826186953795"},{"rel":"self","type":"application/atom+xml","href":"https://www.blogger.com/feeds/4095748245355156272/posts/default/5611209826186953795"},{"rel":"alternate","type":"text/html","href":"https://www.gettrickz.com/2020/01/start-learn-phpmysql-how-to-code-in-php.html","title":" Start Learn PHP/MYSQL : How to Do PHP Development and MySQL Database Connectivity A Complete Guide for Beginners"}],"author":[{"name":{"$t":"Juber Khan Baloch"},"uri":{"$t":"https://www.blogger.com/profile/03500557746501068520"},"email":{"$t":"noreply@blogger.com"},"gd$image":{"rel":"http://schemas.google.com/g/2005#thumbnail","width":"35","height":"35","src":"//www.blogger.com/img/blogger_logo_round_35.png"}}],"media$thumbnail":{"xmlns$media":"http://search.yahoo.com/mrss/","url":"https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEghL5eKZrCu_YChm0F8odjOM92UJVahPJMXZdllX4sDDnnGVzfSU1OAYaQpzI4UadAIXab9A6HXGYvg8-cUKQS4G2btOZ-1b4Al6VHbt-a-ZDxhJCSgDLHT3Ew-C46pgBYyYiNDRgo1oH8TdkGeUzmHKMW64ePpE5l7gi32ZiGShc-E4pd8kQJQsiyz4Q/s72-w320-c-h213/A-Comprehensive-Guide-to-the-Basics-of-Web-Development-and-Database-Connectivity-for-Beginners.jpg","height":"72","width":"72"}},{"id":{"$t":"tag:blogger.com,1999:blog-4095748245355156272.post-8333260498802518629"},"published":{"$t":"2023-02-09T13:04:00.004+05:30"},"updated":{"$t":"2023-02-13T12:16:12.060+05:30"},"category":[{"scheme":"http://www.blogger.com/atom/ns#","term":"installation process"},{"scheme":"http://www.blogger.com/atom/ns#","term":"PHP programming"},{"scheme":"http://www.blogger.com/atom/ns#","term":"Apache"},{"scheme":"http://www.blogger.com/atom/ns#","term":"DATABASE"},{"scheme":"http://www.blogger.com/atom/ns#","term":"computer setup"},{"scheme":"http://www.blogger.com/atom/ns#","term":"MYSQL"},{"scheme":"http://www.blogger.com/atom/ns#","term":"MariaDB"},{"scheme":"http://www.blogger.com/atom/ns#","term":"PHP"},{"scheme":"http://www.blogger.com/atom/ns#","term":"scripting language"},{"scheme":"http://www.blogger.com/atom/ns#","term":"PHP applications"},{"scheme":"http://www.blogger.com/atom/ns#","term":"web server"},{"scheme":"http://www.blogger.com/atom/ns#","term":"XAMPP"},{"scheme":"http://www.blogger.com/atom/ns#","term":"software bundle"},{"scheme":"http://www.blogger.com/atom/ns#","term":"PHP scripts"}],"title":{"type":"text","$t":"Start Learning PHP and MySQL: A Comprehensive Guide to Setting Up PHP on Your Windows or Linux PC"},"content":{"type":"html","$t":"\u003cdiv class\u003d\"separator\" style\u003d\"clear: both; text-align: center;\"\u003e\u003ca href\u003d\"https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgRpIIDvMi4XTfNz61qP3MYxzdi1y_RWCcOeTX3qK8lfZ6uCm7XiwIfiqp3Jyw2uA9kImed5gnKHPe7geKlcS3NvHAvnXDkuqXnHkbk2ygEc5A0puL3YjpW_FuTpOW8cN1aul2tqT4HJrNDXYMsWqEvN8jLqFzRxSEEXJtfjwUsLSo30MUrExV00LjAyA/s800/A-Comprehensive-Guide-to-Setting-Up-PHP-on-Your-Windows-or-Linux-PC.jpg\" imageanchor\u003d\"1\" style\u003d\"clear: left; float: left; margin-bottom: 1em; margin-right: 1em;\"\u003e\u003cimg alt\u003d\"A Comprehensive Guide to Setting Up PHP on Your Windows or Linux PC\" border\u003d\"0\" data-original-height\u003d\"533\" data-original-width\u003d\"800\" height\u003d\"213\" src\u003d\"https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgRpIIDvMi4XTfNz61qP3MYxzdi1y_RWCcOeTX3qK8lfZ6uCm7XiwIfiqp3Jyw2uA9kImed5gnKHPe7geKlcS3NvHAvnXDkuqXnHkbk2ygEc5A0puL3YjpW_FuTpOW8cN1aul2tqT4HJrNDXYMsWqEvN8jLqFzRxSEEXJtfjwUsLSo30MUrExV00LjAyA/w320-h213/A-Comprehensive-Guide-to-Setting-Up-PHP-on-Your-Windows-or-Linux-PC.jpg\" title\u003d\"A Comprehensive Guide to Setting Up PHP on Your Windows or Linux PC\" width\u003d\"320\" /\u003e\u003c/a\u003e\u003c/div\u003e\u003cp\u003eGetting started with PHP programming can be a simple process with the right tools in place. In order to write and run PHP code on your computer, you will need to set up an environment that includes a web server and a database management system.\nThe most popular choice for setting up a local PHP development environment is to use a software stack such as XAMPP. This software bundle includes Apache as the web server, PHP as the scripting language, and MariaDB as the database management system.\nBy following a simple installation process, you can have a fully functional PHP environment ready to use on your computer. This will allow you to create and run PHP scripts and applications, as well as interact with a database using MySQL.\nIn summary, to start using PHP on your computer, you will need to set up a web server and database management system. The easiest way to accomplish this is by using a software bundle like XAMPP.\u003c/p\u003e\n\u003cp\u003eXAMPP is a popular, free, and open-source software stack that includes Apache, MariaDB, PHP, and Perl, and makes it easy to set up a local development environment for web applications. Whether you are a beginner or an experienced developer, getting started with PHP on XAMPP is easy and straightforward. In this article, we will show you how to install and use XAMPP to start using PHP on your Windows or Linux PC.\u003c/p\u003e\n\n\u003cp\u003e\u003cb\u003e\u003cspan style\u003d\"font-size: medium;\"\u003eInstalling XAMPP on Windows\u003c/span\u003e\u003c/b\u003e\u003c/p\u003e\n\u003cp\u003e\nTo install XAMPP on Windows, you will first need to download the installation package from the official website. Once you have downloaded the package, you can double-click it to start the installation process. During the installation process, you will be prompted to select the components you want to install, and you will also be asked to specify the directory in which you want to install XAMPP. After the installation is complete, you can start the XAMPP control panel, which will allow you to start and stop the Apache and MariaDB services.\u003c/p\u003e\n\u003cp style\u003d\"text-align: center;\"\u003e\n\u003ca class\u003d\"btn btn-info\" href\u003d\"https://www.apachefriends.org/download.html\"\u003e\u003cb\u003e\u003cspan style\u003d\"font-size: large;\"\u003eCLICK HERE TO DOWNLOAD XAMMP\u003c/span\u003e\u003c/b\u003e\u003c/a\u003e\u003c/p\u003e\n\u003cp\u003e\u003cb\u003e\u003cspan style\u003d\"font-size: medium;\"\u003eVerifying PHP Installation with XAMPP\u003c/span\u003e\u003c/b\u003e\u003c/p\u003e\n\u003cp\u003e\nXAMPP is a popular, free, and open-source software stack that includes Apache, MariaDB, PHP, and Perl. Once you have successfully installed XAMPP on your Windows or Linux PC, you can verify the PHP installation by creating a PHP file and accessing it through a web browser.\n\nTo start, ensure that XAMPP is running and all the necessary services (Apache, PHP, and MariaDB) are active. You can check this in the XAMPP control panel.\n\nNext, locate the htdocs or www directory within the XAMPP folder on your PC. This is where you will save all your PHP files and folders. To test your PHP installation, create a file named \"test.php\" within this directory.\u003c/p\u003e\u003cp\u003e\n\u003c/p\u003e\u003cblockquote class\u003d\"tr_bq\"\u003e\u003cb\u003e\n\u0026lt;?php\u003cbr /\u003e\necho \"Hello World\";\u003cbr /\u003e\n\u0026nbsp;?\u0026gt;\u003c/b\u003e\u003c/blockquote\u003e\n\u003cp\u003eSave the file and access it through your web browser. If everything is set up correctly, you should see the message \"Hello World!\" displayed in your browser.\n  \"In order to run a PHP file on your local system, you will need to access it through a web browser. This can be achieved by using the following URL format: localhost://[filename]. Replace [filename] with the name of your PHP file, including the .php extension. For example, if your file is named test.php, the URL to access it in your browser would be localhost://test.php. Ensure that your web server (such as XAMPP) is running and configured correctly before attempting to access the PHP file in your browser.\"\n\nWith this simple test, you have successfully confirmed the installation and setup of PHP on your Windows or Linux PC using XAMPP.\n\u003c/p\u003e\n\u003cp\u003e\u003cb\u003e\u003cspan style\u003d\"font-size: medium;\"\u003eInstalling XAMPP on Linux\u003c/span\u003e\u003c/b\u003e\u003c/p\u003e\n\u003cp\u003e\nTo install XAMPP on Linux, you will first need to download the installation package from the official website. Once you have downloaded the package, you can extract its contents to the directory in which you want to install XAMPP. Next, you will need to navigate to the extracted directory in a terminal window and run the following command to start the installation process:\n\u003c/p\u003e\n\u003cblockquote\u003e\u003cb\u003esudo bash xampp-linux-x64-7.4.15-0-installer.run\u003c/b\u003e\u003c/blockquote\u003e\n\n\u003cp\u003eDuring the installation process, you will be prompted to select the components you want to install, and you will also be asked to specify the directory in which you want to install XAMPP. After the installation is complete, you can start the XAMPP control panel, which will allow you to start and stop the Apache and MariaDB services.\u003c/p\u003e\u003cp\u003e\n\n\u003c/p\u003e\u003cp\u003eOnce XAMPP is installed and running, you can test your PHP installation by creating a PHP file and accessing it in a web browser. For example, you can create a file called test.php in the htdocs directory of your XAMPP installation and add the following code to it:\u003c/p\u003e\n\n\u003cblockquote class\u003d\"tr_bq\"\u003e\u003cb\u003e\n\u0026lt;?php\u003cbr /\u003e\necho \"Hello World\";\u003cbr /\u003e\n\u0026nbsp;?\u0026gt;\u003c/b\u003e\u003c/blockquote\u003e\n\u003cp\u003eSave the file and access it through your web browser. If everything is set up correctly, you should see the message \"Hello World\" displayed in your browser.\n  \"In order to run a PHP file on your local system, you will need to access it through a web browser. This can be achieved by using the following URL format: localhost://[filename]. Replace [filename] with the name of your PHP file, including the .php extension. For example, if your file is named test.php, the URL to access it in your browser would be localhost://test.php. Ensure that your web server (such as XAMPP) is running and configured correctly before attempting to access the PHP file in your browser.\"\n\nWith this simple test, you have successfully confirmed the installation and setup of PHP on your Windows or Linux PC using XAMPP.\n\u003c/p\u003e\n\n\u003cp\u003e\u003c/p\u003e\u003cp\u003e\u003c/p\u003e\u003cp\u003e\u003c/p\u003e\u003cp\u003e\u003c/p\u003e"},"link":[{"rel":"edit","type":"application/atom+xml","href":"https://www.blogger.com/feeds/4095748245355156272/posts/default/8333260498802518629"},{"rel":"self","type":"application/atom+xml","href":"https://www.blogger.com/feeds/4095748245355156272/posts/default/8333260498802518629"},{"rel":"alternate","type":"text/html","href":"https://www.gettrickz.com/2020/01/start-learn-phpmysql-start-using-php-in.html","title":"Start Learning PHP and MySQL: A Comprehensive Guide to Setting Up PHP on Your Windows or Linux PC"}],"author":[{"name":{"$t":"Juber Khan Baloch"},"uri":{"$t":"https://www.blogger.com/profile/03500557746501068520"},"email":{"$t":"noreply@blogger.com"},"gd$image":{"rel":"http://schemas.google.com/g/2005#thumbnail","width":"35","height":"35","src":"//www.blogger.com/img/blogger_logo_round_35.png"}}],"media$thumbnail":{"xmlns$media":"http://search.yahoo.com/mrss/","url":"https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgRpIIDvMi4XTfNz61qP3MYxzdi1y_RWCcOeTX3qK8lfZ6uCm7XiwIfiqp3Jyw2uA9kImed5gnKHPe7geKlcS3NvHAvnXDkuqXnHkbk2ygEc5A0puL3YjpW_FuTpOW8cN1aul2tqT4HJrNDXYMsWqEvN8jLqFzRxSEEXJtfjwUsLSo30MUrExV00LjAyA/s72-w320-c-h213/A-Comprehensive-Guide-to-Setting-Up-PHP-on-Your-Windows-or-Linux-PC.jpg","height":"72","width":"72"}},{"id":{"$t":"tag:blogger.com,1999:blog-4095748245355156272.post-307787340563360934"},"published":{"$t":"2016-05-08T16:40:00.003+05:30"},"updated":{"$t":"2023-02-16T17:32:05.344+05:30"},"category":[{"scheme":"http://www.blogger.com/atom/ns#","term":"DATABASE"},{"scheme":"http://www.blogger.com/atom/ns#","term":"MYSQL"},{"scheme":"http://www.blogger.com/atom/ns#","term":"PHP"}],"title":{"type":"text","$t":"Start Learn PHP/MYSQL : What Is MySQL ? Why MySQL ?"},"content":{"type":"html","$t":"\u003cdiv dir\u003d\"ltr\" style\u003d\"text-align: left;\" trbidi\u003d\"on\"\u003e\n\u003cdiv class\u003d\"separator\" style\u003d\"clear: both; text-align: center;\"\u003e\n\u003c/div\u003e\n\u003cdiv class\u003d\"row\"\u003e\n\u003cdiv class\u003d\"col-md-3\"\u003e\n\u003ca href\u003d\"https://lh3.googleusercontent.com/-nkFcdel9Ds4/Vy8fcPnnw2I/AAAAAAAADpM/90Lusyis2jMcMWcBRurYOxHP1aCJH890ACLcB/s1600/MySQL.svg.png\" style\u003d\"clear: left; float: left; margin-bottom: 1em; margin-right: 1em;\"\u003e\u003cimg border\u003d\"0\" height\u003d\"166\" src\u003d\"https://lh3.googleusercontent.com/-nkFcdel9Ds4/Vy8fcPnnw2I/AAAAAAAADpM/90Lusyis2jMcMWcBRurYOxHP1aCJH890ACLcB/w320-h166/MySQL.svg.png\" width\u003d\"320\" /\u003e\u003c/a\u003e\u003c/div\u003e\n\u003cdiv class\u003d\"col-md-9\"\u003e\nMySQL is the most popular database system used with PHP. MySQL is an open-source relational database management system (RDBMS). In July 2013, it was the world's second most widely used RDBMS, and the most widely used open-source client–server model RDBMS It is named after Michael Widenius' (who is a co-founder of MySQL) daughter, My, while \"SQL\" stands as the abbreviation for Structured Query Language. The MySQL development project has made its source code available under the terms of the GNU General Public License, as well as under a variety of proprietary agreements. MySQL was owned and sponsored by a single for-profit firm, the Swedish company MySQL AB, now owned by Oracle Corporation. For proprietary use, several paid editions are available, and offer additional functionality.\u003cbr /\u003e\n\u003cbr /\u003e\n\u003cb\u003eWhat Is MySql:\u003c/b\u003e\u003cbr /\u003e\n\u003cul\u003e\n\u003cli\u003e\nMySQL is a database system used on the web\u003c/li\u003e\n\u003cli\u003e\nMySQL is a database system that runs on a server\u003c/li\u003e\n\u003cli\u003e\nMySQL is ideal for both small and large applications\u003c/li\u003e\n\u003cli\u003e\nMySQL is very fast, reliable, and easy to use\u003c/li\u003e\n\u003cli\u003e\nMySQL uses standard SQL\u003c/li\u003e\n\u003cli\u003e\nMySQL compiles on a number of platforms\u003c/li\u003e\n\u003cli\u003e\nMySQL is free to download and use\u003c/li\u003e\n\u003cli\u003e\nMySQL is developed, distributed, and supported by Oracle Corporation\u003c/li\u003e\n\u003c/ul\u003e\nPHP combined with MySQL are cross-platform (you can develop in Windows and serve on a Unix platform)\u003cbr /\u003e\n\u003cb\u003eDefinition And Features\u003c/b\u003e\u003cbr /\u003e\nMySQL is a relational database system. MySQL is faster, more reliable, and Free , better than any other database system (including commercial systems such as Oracle and DB2).We can safely say that there is a large bandwidth of opinion.\u003cbr /\u003e\nThere is an ever increasing number of MySQL users, and majority of them are quite satisfied with MySQL.\u003cbr /\u003e\nIts also that MySQL still lacks a number of features that are taken for granted with other database systems. If you require such features, then MySQL is not the database system for you.\u003cbr /\u003e\n\u003cb\u003eFeatures of MySQL\u003c/b\u003e\u003cbr /\u003e\nThe following list shows the most important properties of MySQL. This section is directed to the reader who already has some knowledge of relational databases. We will use some terminology from the relational database world without defining our terms exactly. On the other hand, the explanations should make it possible for database novices to understand to some extent what we are talking about.\u003cbr /\u003e\n\u003cb\u003eRelational Database System\u003c/b\u003e: Like almost all other database systems on the market, MySQL is a relational database system.\u003cbr /\u003e\n\u003cb\u003eClient/Server Architecture\u003c/b\u003e: MySQL is a client/server system. There is a database server (MySQL) and arbitrarily many clients (application programs), which communicate with the server; that is, they query data, save changes, etc. The clients can run on the same computer as the server or on another computer (communication via a local network or the Internet)\u003cbr /\u003e\nAlmost all of the familiar large database systems (Oracle, Microsoft SQL Server, etc.) are client/server systems. These are in contrast to the file-server systems, which include Microsoft Access, dBase and FoxPro. The decisive drawback to file-server systems is that when run over a network, they become extremely inefficient as the number of users grows.\u003cbr /\u003e\n\u003cb\u003eWhy MySQL?\u003c/b\u003e\u003cbr /\u003e\nMany of the world's largest and fastest-growing organizations including Facebook, Google, Adobe, Alcatel Lucent and Zappos rely on MySQL to save time and money powering their high-volume Web sites, business-critical systems and packaged software.\u003cbr /\u003e\n\u003cb\u003eType Of Query Example:\u003c/b\u003e\u003cbr /\u003e\nCreate Statement:Use To Create Database and Tables\u003cbr /\u003e\n\u003cbr /\u003e\n\u003cbr /\u003e\n\u003cblockquote\u003e\nCREATE DATABASE dbname;\u003c/blockquote\u003e\nFor Tables:\u003cbr /\u003e\n\u003cbr /\u003e\n\u003cblockquote\u003e\nCREATE TABLE table_name\n(\ncolumn_name1 data_type(size),\ncolumn_name2 data_type(size),\ncolumn_name3 data_type(size),\n....\n);\u003c/blockquote\u003e\nAlter Statement:is used to add, delete, or modify columns in an existing table\u003cbr /\u003e\nTo add a column in a table, use the following syntax:\u003cbr /\u003e\n\u003cbr /\u003e\n\u003cblockquote\u003e\nALTER TABLE table_name\nADD column_name datatype\u003c/blockquote\u003e\nTo delete a column in a table:\u003cbr /\u003e\n\u003cbr /\u003e\n\u003cblockquote\u003e\nALTER TABLE table_name\nDROP COLUMN column_name\u003c/blockquote\u003e\nTo change the data type of a column in a table:\u003cbr /\u003e\n\u003cbr /\u003e\n\u003cblockquote\u003e\nALTER TABLE table_name\nALTER COLUMN column_name datatype\u003c/blockquote\u003e\nInsert Statement:is used to add new records to a MySQL table\u003cbr /\u003e\n\u003cbr /\u003e\n\u003cblockquote\u003e\nINSERT INTO table_name (column1, column2, column3,...)\nVALUES (value1, value2, value3,...)\u003c/blockquote\u003e\nUpdate Statement:is used to update existing records in a table\u003cbr /\u003e\n\u003cbr /\u003e\n\u003cblockquote\u003e\nUPDATE table_name\nSET column1\u003dvalue, column2\u003dvalue2,...\nWHERE some_column\u003dsome_value \u003c/blockquote\u003e\nDelete statement: is used to delete records from a table\u003cbr /\u003e\n\u003cbr /\u003e\n\u003cblockquote\u003e\nDELETE FROM table_name\nWHERE some_column \u003d some_value\n\u003c/blockquote\u003e\nSelect Statement:Its Use Display all the data From Table\u003cbr /\u003e\n\u003cbr /\u003e\n\u003cblockquote\u003e\nSELECT * FROM table_name\u003c/blockquote\u003e\n\u003c/div\u003e\n\u003c/div\u003e\n\u003c/div\u003e\n"},"link":[{"rel":"replies","type":"application/atom+xml","href":"https://www.gettrickz.com/feeds/307787340563360934/comments/default","title":"Post Comments"},{"rel":"replies","type":"text/html","href":"https://www.gettrickz.com/2016/05/start-learn-phpmysql-what-is-mysql-why.html#comment-form","title":"0 Comments"},{"rel":"edit","type":"application/atom+xml","href":"https://www.blogger.com/feeds/4095748245355156272/posts/default/307787340563360934"},{"rel":"self","type":"application/atom+xml","href":"https://www.blogger.com/feeds/4095748245355156272/posts/default/307787340563360934"},{"rel":"alternate","type":"text/html","href":"https://www.gettrickz.com/2016/05/start-learn-phpmysql-what-is-mysql-why.html","title":"Start Learn PHP/MYSQL : What Is MySQL ? Why MySQL ?"}],"author":[{"name":{"$t":"Juber Khan Baloch"},"uri":{"$t":"https://www.blogger.com/profile/03500557746501068520"},"email":{"$t":"noreply@blogger.com"},"gd$image":{"rel":"http://schemas.google.com/g/2005#thumbnail","width":"35","height":"35","src":"//www.blogger.com/img/blogger_logo_round_35.png"}}],"media$thumbnail":{"xmlns$media":"http://search.yahoo.com/mrss/","url":"https://lh3.googleusercontent.com/-nkFcdel9Ds4/Vy8fcPnnw2I/AAAAAAAADpM/90Lusyis2jMcMWcBRurYOxHP1aCJH890ACLcB/s72-w320-c-h166/MySQL.svg.png","height":"72","width":"72"},"thr$total":{"$t":"0"}},{"id":{"$t":"tag:blogger.com,1999:blog-4095748245355156272.post-6753173933111980369"},"published":{"$t":"2016-04-29T00:02:00.003+05:30"},"updated":{"$t":"2023-02-22T15:03:02.432+05:30"},"category":[{"scheme":"http://www.blogger.com/atom/ns#","term":"MVC"},{"scheme":"http://www.blogger.com/atom/ns#","term":"MYSQL"},{"scheme":"http://www.blogger.com/atom/ns#","term":"PHP"},{"scheme":"http://www.blogger.com/atom/ns#","term":"Howto"}],"title":{"type":"text","$t":"Start Learn PHP/MYSQL: What is PHP ? How to Learn PHP Easily ?"},"content":{"type":"html","$t":"\u003cdiv dir\u003d\"ltr\" style\u003d\"text-align: left;\" trbidi\u003d\"on\"\u003e\n\u003ca href\u003d\"https://2.bp.blogspot.com/-STuqojpdEoA/VyJWkSMtglI/AAAAAAAADog/H60kXR1e8-8wTR69Mal7ykbYSDwdXe_mACLcB/s1600/PHP-logo.svg.png\" style\u003d\"clear: left; float: left; margin-bottom: 1em; margin-right: 1em;\"\u003e\u003cimg border\u003d\"0\" height\u003d\"169\" src\u003d\"https://2.bp.blogspot.com/-STuqojpdEoA/VyJWkSMtglI/AAAAAAAADog/H60kXR1e8-8wTR69Mal7ykbYSDwdXe_mACLcB/s320/PHP-logo.svg.png\" width\u003d\"320\" /\u003e\u003c/a\u003e\u003cp\u003eIt has been quite some time since I started working as a PHP developer , and I've been contemplating the idea of sharing my knowledge of PHP with readers. In this post, I aim to provide an overview of PHP for beginners.\n\u003c/p\u003e\n\u003ch3\u003eDefinition and Full Form:\u003c/h3\u003e\n\u003cp\u003eTo begin with, PHP is a server-side scripting language that was first introduced by Rasmus Lerdorf in 1994. The term PHP is an acronym that stands for Personal Home Page, but it is now more commonly referred to as PHP: Hypertext Preprocessor.\u003c/p\u003e\n\u003cb\u003eWhat is server-side scripting language?\u003c/b\u003e\u003cbr /\u003e\n\u003cb\u003eServer-side scripting language \u003c/b\u003eexecute (run) on the server. server-side environment that runs a scripting language is a web server. A user 's request is fulfilled by running a script directly on the web server to generate dynamic HTML pages. This HTML is then sent to the client browser. It is usually used to provide interactive web sites that interface to databases or other data stores on the server.\u003cbr /\u003e\n\u003cbr /\u003e\n\u003cp\u003eAs a server-side scripting language, PHP is primarily used for building dynamic web applications that can run on various web servers, such as Apache and Nginx. With PHP, developers can create web pages that can interact with databases, process user input, and generate dynamic content.\n\u003c/p\u003e\u003cp\u003e\nFor beginners who are just starting to learn PHP, it is essential to understand the basics of the language, such as its syntax and structure. PHP code is executed on the server, and the output is sent to the user's browser in the form of HTML. To execute PHP code , it must be written within special tags that start with \"\u003c?php\" and end with \"?\u003e\".\n\u003c/p\u003e\u003cp\u003e\nOne of the significant benefits of PHP is its compatibility with various platforms and operating systems, including Windows, Linux, and macOS. Additionally, PHP has a vast community of developers who have created numerous frameworks, libraries, and tools to make web development faster and more efficient.\u003c/p\u003e\n\u003cb\u003eWhat You Mean By Hypertext Preprocessor ?\u003c/b\u003e\u003cbr /\u003e\nHypertext Preprocessor (It is a recursive acronym, if you can understand what that means.) PHP is an HTML-embedded Web scripting language. This means PHP code can be inserted into the HTML of a Web page. When a PHP page is accessed, the PHP code is read or \"parsed\" by the server the page resides on. The output from the PHP functions on the page are typically returned as HTML code, which can be read by the browser. Because the PHP code is transformed into HTML before the page is loaded, users cannot view the PHP code on a page. This make PHP pages secure enough to access databases and other secure information.\u003cbr /\u003e\n\u003cbr /\u003e\n  \n\u003cb\u003ePHP5\u003c/b\u003e\u003cbr /\u003e\nPHP 5 was released in July 2004 . It is mainly driven by its core, the Zend Engine 2.0 with a new object model and dozens of other new features.\n\nPHP-related and supporting projects, such as PEAR, PECL, and documentation, and an underlying network infrastructure of well over one-hundred individual web servers on six of the seven continents of the world.\u003cbr /\u003e\n\u003cbr /\u003e\n\u003cb\u003eExample Syntax.\u003c/b\u003e\u003cbr /\u003e\n\u003cblockquote class\u003d\"tr_bq\"\u003e\n\u0026lt;?php\u003cbr /\u003e\necho \"Hello World\";\u003cbr /\u003e\n\u0026nbsp;?\u0026gt;\u003c/blockquote\u003e\nOutput:Hello World\u003c/div\u003e\n"},"link":[{"rel":"edit","type":"application/atom+xml","href":"https://www.blogger.com/feeds/4095748245355156272/posts/default/6753173933111980369"},{"rel":"self","type":"application/atom+xml","href":"https://www.blogger.com/feeds/4095748245355156272/posts/default/6753173933111980369"},{"rel":"alternate","type":"text/html","href":"https://www.gettrickz.com/2016/04/start-learn-php-what-is-php-how-to.html","title":"Start Learn PHP/MYSQL: What is PHP ? How to Learn PHP Easily ?"}],"author":[{"name":{"$t":"Juber Khan Baloch"},"uri":{"$t":"https://www.blogger.com/profile/03500557746501068520"},"email":{"$t":"noreply@blogger.com"},"gd$image":{"rel":"http://schemas.google.com/g/2005#thumbnail","width":"35","height":"35","src":"//www.blogger.com/img/blogger_logo_round_35.png"}}],"media$thumbnail":{"xmlns$media":"http://search.yahoo.com/mrss/","url":"https://2.bp.blogspot.com/-STuqojpdEoA/VyJWkSMtglI/AAAAAAAADog/H60kXR1e8-8wTR69Mal7ykbYSDwdXe_mACLcB/s72-c/PHP-logo.svg.png","height":"72","width":"72"}}]}});