{"id":835,"date":"2019-07-10T19:19:14","date_gmt":"2019-07-10T16:19:14","guid":{"rendered":"http:\/\/www.hawlast.com\/blog\/?p=835"},"modified":"2021-09-05T18:27:06","modified_gmt":"2021-09-05T15:27:06","slug":"how-to-start-with-php","status":"publish","type":"post","link":"https:\/\/www.hawlast.com\/blog\/how-to-start-with-php\/","title":{"rendered":"How to start with PHP"},"content":{"rendered":"<p>This is a quick guide to help you write your first PHP code.<\/p>\n<pre><span style=\"color: #800000;\">&lt; ?php echo \"My first PHP code\"; ?&gt;<\/span><\/pre>\n<blockquote><p>PHP is a popular general-purpose scripting language that is especially suited to web development. Fast, flexible and pragmatic, PHP powers everything from your blog to the most popular websites in the world.- <strong><em>php.net<\/em><\/strong><\/p><\/blockquote>\n<p><strong>Knowledge:<\/strong><br \/>\nYou need some basic knowledge of HTML and CSS. PHP outputs results to the browser&#8230;in HTML \/ CSS format&#8230;<br \/>\n<!--more--><\/p>\n<p><strong>Software:<\/strong><\/p>\n<ol>\n<li>PHP needs a <a href=\"https:\/\/www.hawlast.com\">web server that has PHP installed<\/a>, or use install a free Wamp server on your machine. My favorite is <a href=\"https:\/\/www.uwamp.com\/en\/\">UwAmp<\/a><\/li>\n<li><a href=\"https:\/\/www.pnotepad.org\/\">Programmer&#8217;s Notepad <\/a><em>(It numbers your code. You can see the line number with an error for example)<\/em><\/li>\n<li>Notepad<\/li>\n<\/ol>\n<p><strong>How to install a Wampserver on your machine<\/strong><\/p>\n<p>Go to uwamp.com and download and install the software. The beauty with UwAmp is that you can run it in any drive on your machine or on a flash disk \/ USB stick.<\/p>\n<p>Once you install, click on the UwAmp icon. You should have the below user interface.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-838\" src=\"http:\/\/www.hawlast.com\/blog\/wp-content\/uploads\/2019\/07\/php-uwamp-server.png\" alt=\"UwAmp Server\" width=\"273\" height=\"350\" srcset=\"https:\/\/www.hawlast.com\/blog\/wp-content\/uploads\/2019\/07\/php-uwamp-server.png 273w, https:\/\/www.hawlast.com\/blog\/wp-content\/uploads\/2019\/07\/php-uwamp-server-234x300.png 234w\" sizes=\"auto, (max-width: 273px) 100vw, 273px\" \/><\/p>\n<p>Click on www folder and inside it, create your first PHP project folder. You can name the folder PHP.<\/p>\n<p><strong>Write your first line of PHP code<\/strong><br \/>\nInstall <a href=\"https:\/\/www.pnotepad.org\/\">Programmer&#8217;s Notepad<\/a>, and launch it. Type in the below text.<\/p>\n<pre><\/pre>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-843\" src=\"http:\/\/www.hawlast.com\/blog\/wp-content\/uploads\/2019\/07\/first-php-code-live.jpg\" alt=\"first PHP code\" width=\"953\" height=\"424\" srcset=\"https:\/\/www.hawlast.com\/blog\/wp-content\/uploads\/2019\/07\/first-php-code-live.jpg 953w, https:\/\/www.hawlast.com\/blog\/wp-content\/uploads\/2019\/07\/first-php-code-live-300x133.jpg 300w, https:\/\/www.hawlast.com\/blog\/wp-content\/uploads\/2019\/07\/first-php-code-live-768x342.jpg 768w\" sizes=\"auto, (max-width: 953px) 100vw, 953px\" \/><\/p>\n<p>Go to <strong>File<\/strong> and<strong> Save As&#8230;<\/strong>and look for the PHP folder that you created.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-844\" src=\"http:\/\/www.hawlast.com\/blog\/wp-content\/uploads\/2019\/07\/Save-php-file.jpg\" alt=\"\" width=\"862\" height=\"539\" srcset=\"https:\/\/www.hawlast.com\/blog\/wp-content\/uploads\/2019\/07\/Save-php-file.jpg 862w, https:\/\/www.hawlast.com\/blog\/wp-content\/uploads\/2019\/07\/Save-php-file-300x188.jpg 300w, https:\/\/www.hawlast.com\/blog\/wp-content\/uploads\/2019\/07\/Save-php-file-768x480.jpg 768w\" sizes=\"auto, (max-width: 862px) 100vw, 862px\" \/><\/p>\n<p>Write index. Your first index.php file.<\/p>\n<p>Now you can go to your browser and type localhost\/PHP\/ in the browser address.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-845\" src=\"http:\/\/www.hawlast.com\/blog\/wp-content\/uploads\/2019\/07\/php-is-live.jpg\" alt=\"PHP code is live\" width=\"764\" height=\"439\" srcset=\"https:\/\/www.hawlast.com\/blog\/wp-content\/uploads\/2019\/07\/php-is-live.jpg 764w, https:\/\/www.hawlast.com\/blog\/wp-content\/uploads\/2019\/07\/php-is-live-300x172.jpg 300w\" sizes=\"auto, (max-width: 764px) 100vw, 764px\" \/><\/p>\n<p>That above is your first PHP code &#8230; live!<\/p>\n<p><strong>Some PHP resources online:<\/strong><br \/>\n&gt; <a href=\"https:\/\/www.php.net\/manual\/en\/getting-started.php\">PHP official site\u00a0<\/a><br \/>\n&gt; <a href=\"https:\/\/phptherightway.com\/\">PHP the right way\u00a0<\/a><br \/>\n&gt; <a href=\"https:\/\/www.codecademy.com\/learn\/learn-php\">PHP Course at Code Academy\u00a0<\/a><br \/>\n&gt; <a href=\"https:\/\/jobtensor.com\/Tutorial\/PHP\/en\/Introduction\">Job Tensor &#8211; Introduction to PHP<\/a><\/p>\n<p><strong>Advanced database manipulation using PHP<\/strong><br \/>\n&gt; <a href=\"https:\/\/phpdelusions.net\/articles\">PHP Delusions<\/a><\/p>\n<p><strong>Questions and answers<\/strong><\/p>\n<p>Google or go to <a href=\"https:\/\/stackoverflow.com\/questions\/tagged\/php\">Stack Overflow<\/a>.<\/p>\n<!-- AddThis Advanced Settings generic via filter on the_content --><!-- AddThis Share Buttons generic via filter on the_content -->","protected":false},"excerpt":{"rendered":"<p>This is a quick guide to help you write your first PHP code. &lt; ?php echo &#8220;My first PHP code&#8221;;&hellip;<!-- AddThis Advanced Settings generic via filter on wp_trim_excerpt --><!-- AddThis Share Buttons generic via filter on wp_trim_excerpt --><\/p>\n","protected":false},"author":375,"featured_media":843,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[17,3],"tags":[103,104],"class_list":["post-835","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-hosting-kenya","category-web-design-tips","tag-php","tag-uwamp"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/www.hawlast.com\/blog\/wp-json\/wp\/v2\/posts\/835","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.hawlast.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.hawlast.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.hawlast.com\/blog\/wp-json\/wp\/v2\/users\/375"}],"replies":[{"embeddable":true,"href":"https:\/\/www.hawlast.com\/blog\/wp-json\/wp\/v2\/comments?post=835"}],"version-history":[{"count":3,"href":"https:\/\/www.hawlast.com\/blog\/wp-json\/wp\/v2\/posts\/835\/revisions"}],"predecessor-version":[{"id":876,"href":"https:\/\/www.hawlast.com\/blog\/wp-json\/wp\/v2\/posts\/835\/revisions\/876"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.hawlast.com\/blog\/wp-json\/wp\/v2\/media\/843"}],"wp:attachment":[{"href":"https:\/\/www.hawlast.com\/blog\/wp-json\/wp\/v2\/media?parent=835"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.hawlast.com\/blog\/wp-json\/wp\/v2\/categories?post=835"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.hawlast.com\/blog\/wp-json\/wp\/v2\/tags?post=835"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}