<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Afolabi Adekunle</title>
    <description>The latest articles on DEV Community by Afolabi Adekunle (@kluxury).</description>
    <link>https://dev.to/kluxury</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F171417%2Fc4719a0a-a02a-4ebd-80c3-5d889b59fbd0.jpeg</url>
      <title>DEV Community: Afolabi Adekunle</title>
      <link>https://dev.to/kluxury</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/kluxury"/>
    <language>en</language>
    <item>
      <title>PHP language Building Block</title>
      <dc:creator>Afolabi Adekunle</dc:creator>
      <pubDate>Sat, 01 Jun 2019 17:10:24 +0000</pubDate>
      <link>https://dev.to/kluxury/php-language-building-block-18km</link>
      <guid>https://dev.to/kluxury/php-language-building-block-18km</guid>
      <description>&lt;p&gt;PHP building block includes variables, operators, data types, constants and literals.&lt;/p&gt;

&lt;h2&gt;
  
  
  PHP Compared to Its Contemporaries
&lt;/h2&gt;

&lt;p&gt;PHP is easier to learn and allows for basic things to be done easily plus it is not MVC strict compared to Ruby on rails. On the downside as it is not MVC strict, it doesn't encourage good practice.&lt;/p&gt;

&lt;h2&gt;
  
  
  PHP Installation
&lt;/h2&gt;

&lt;p&gt;Before you can write and test your PHP scripts, there's one thing you'll need - a server!, because PHP is a server-sided scripting language, you either have to get some web space with a hosting company that supports PHP, or make your computer pretend that it has a server installed. This is because PHP is not run on your PC - it's executed on the server. The results are then sent back to the client PC (your computer).&lt;/p&gt;

&lt;h4&gt;
  
  
  Apple Users
&lt;/h4&gt;

&lt;p&gt;If you have OS X, then try these sites to get up and running with PHP:&lt;/p&gt;

&lt;p&gt;&lt;a href="http://www.onlamp.com/pub/a/mac/2001/12/07/apache.html"&gt;Onlamp.com&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="http://www.entropy.ch/software/macosx/php/"&gt;entropy.com&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;What you're doing here is getting the apache server up and running, so that you can run PHP scripts offline. Pay particular attention to where files are stored, and to the "localhost" address.&lt;/p&gt;

&lt;h4&gt;
  
  
  Linux Users
&lt;/h4&gt;

&lt;p&gt;There are quite a few sites out there to help Linux users get up and running with the Apache server and PHP. Here are three sites that are worth checking out:&lt;/p&gt;

&lt;p&gt;&lt;a href="http://en.wikipedia.org/wiki/LAMP_(software_bundle)"&gt;Wiki&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="http://www.php-mysql-tutorial.com/wikis/php-tutorial/installing-php-and-mysql.aspx"&gt;Php and MySQL tutorial&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="http://www.phpfreaks.com/tutorials/12/0.php"&gt;php freaks&lt;/a&gt;&lt;/p&gt;

&lt;h4&gt;
  
  
  Windows User
&lt;/h4&gt;

&lt;p&gt;Download Xampp, Lampp or Wampp (recommended) and follow the installation process.&lt;/p&gt;

&lt;h2&gt;
  
  
  PHP Delimiters
&lt;/h2&gt;

&lt;p&gt;PHP delimiters are nothing but the open close tags to enclose PHP script. PHP code can be parsed if and only if it is enclosed with these delimiters.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight php"&gt;&lt;code&gt;&lt;span class="cp"&gt;&amp;lt;?php&lt;/span&gt; 
&lt;span class="c1"&gt;//-------code goes here---&lt;/span&gt;
&lt;span class="cp"&gt;?&amp;gt;&lt;/span&gt; 
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Variable Initialization with PHP
&lt;/h2&gt;

&lt;p&gt;A variable consists of a name of your choosing, preceded by a dollar sign ($). Variable names can include letters, numbers, and the underscore character (_). They cannot include spaces. They must begin with a letter or an underscore. The following code defines some legal variables:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight php"&gt;&lt;code&gt;&lt;span class="cp"&gt;&amp;lt;?php&lt;/span&gt; 
&lt;span class="nv"&gt;$man&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="nv"&gt;$a_long_name&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="nv"&gt;$N123&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="cp"&gt;?&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  PHP Data types
&lt;/h2&gt;

&lt;p&gt;PHP allows eight different types of data types. All of them are discussed below. The first five are called simple data types and the last three are compound data types:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Integer&lt;/strong&gt; : Integers hold only whole numbers including positive and negative numbers, i.e., numbers without fractional part or decimal point. They can be decimal (base 10), octal (base 8) or hexadecimal (base 16). The default base is decimal (base 10). The octal integers can be declared with leading 0 and the hexadecimal can be declared with leading 0x. The range of integers must lie between -2^31 to 2^31.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight php"&gt;&lt;code&gt;&lt;span class="cp"&gt;&amp;lt;?php&lt;/span&gt; 
&lt;span class="nv"&gt;$Age&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;31&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="c1"&gt;//31 here is an integer&lt;/span&gt;
&lt;span class="cp"&gt;?&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Double&lt;/strong&gt; : Can hold numbers containing fractional or decimal part including positive and negative numbers. By default, the variables add a minimum number of decimal places.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight php"&gt;&lt;code&gt;&lt;span class="cp"&gt;&amp;lt;?php&lt;/span&gt; 
&lt;span class="nv"&gt;$pi&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mf"&gt;3.1428&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="cp"&gt;?&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;String&lt;/strong&gt; : Hold letters or any alphabets, even numbers are included. These are written within double quotes during declaration. The strings can also be written within single quotes but it will be treated differently while printing variables.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight php"&gt;&lt;code&gt;&lt;span class="cp"&gt;&amp;lt;?php&lt;/span&gt; 
&lt;span class="nv"&gt;$name&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"Adekunle"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="cp"&gt;?&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;NULL&lt;/strong&gt; : These are special types of variables that can hold only one value i.e., NULL. We follow the convention of writing it in capital form, but its case sensitive.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight php"&gt;&lt;code&gt;&lt;span class="cp"&gt;&amp;lt;?php&lt;/span&gt; 
&lt;span class="nv"&gt;$Size&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kc"&gt;null&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="cp"&gt;?&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Boolean&lt;/strong&gt; : Hold only two values, either TRUE or FALSE. Successful events will return true and unsuccessful events return false. NULL type values are also treated as false in Boolean. Apart from NULL, 0 is also consider as false in boolean. If a string is empty then it is also considered as false in boolean data type.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight php"&gt;&lt;code&gt;&lt;span class="cp"&gt;&amp;lt;?php&lt;/span&gt; 
&lt;span class="nv"&gt;$Admin&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="cp"&gt;?&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Arrays&lt;/strong&gt; : Array is a compound data-type which can store multiple values of same data type.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight php"&gt;&lt;code&gt;&lt;span class="cp"&gt;&amp;lt;?php&lt;/span&gt; 
&lt;span class="nv"&gt;$odds&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;array&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;5&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;7&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;9&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="cp"&gt;?&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Objects&lt;/strong&gt;: Objects are defined as instances of user defined classes that can hold both values and functions. This is an advanced topic and will be discussed in details in further articles.&lt;br&gt;
&lt;strong&gt;Resources&lt;/strong&gt;: Resources in PHP are not an exact data type. These are basically used to store references to some function call or to external PHP resources. For example, consider a database call. This is an external resource.&lt;/p&gt;
&lt;h2&gt;
  
  
  PHP Constants
&lt;/h2&gt;

&lt;p&gt;When you require a variable that doesn't change through out the script, then you need a constant.You must use PHP's built-in define() function to create a constant. After you have done this, the constant cannot be changed. To use the define() function, you must place the name of the constant and the value you want to give it within the call's parentheses. These values must be separated by a comma&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight php"&gt;&lt;code&gt;&lt;span class="cp"&gt;&amp;lt;?php&lt;/span&gt; 
&lt;span class="nb"&gt;define&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"Username"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"Alchemist"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="cp"&gt;?&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  PHP Operators
&lt;/h2&gt;

&lt;p&gt;An operator is a symbol or series of symbols that, when used in conjunction with values, performs an action and usually produces a new value.&lt;/p&gt;

&lt;h3&gt;
  
  
  Types of Operators
&lt;/h3&gt;

&lt;h4&gt;
  
  
  Assignment Operator
&lt;/h4&gt;

&lt;p&gt;It consists of the single character =. The assignment operator takes the value of its right-hand operand and assigns it to its left-hand operand:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight php"&gt;&lt;code&gt;&lt;span class="cp"&gt;&amp;lt;?php&lt;/span&gt; 
&lt;span class="nv"&gt;$Age&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;21&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="cp"&gt;?&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  Concantenation Operator
&lt;/h4&gt;

&lt;p&gt;The concatenation operator is represented by a single period. Treating both operands as strings, it appends the right-hand operand to the left.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight php"&gt;&lt;code&gt;&lt;span class="cp"&gt;&amp;lt;?php&lt;/span&gt; 
&lt;span class="nv"&gt;$firstname&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"Adekunle"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="nv"&gt;$lastname&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"Afolabi"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="n"&gt;name&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;echo&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$firstname&lt;/span&gt; &lt;span class="mf"&gt;.&lt;/span&gt; &lt;span class="nv"&gt;$lastname&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="cp"&gt;?&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  Arithmetic Operators
&lt;/h4&gt;

&lt;p&gt;The arithmetic operators do exactly what you would expect?they perform arithmetic operations. The addition operator (+) adds the right operand to the left operand. The subtraction operator (-) subtracts the right-hand operand from the left. The division operator (/) divides the left-hand operand by the right. The multiplication operator (*) multiplies the left-hand operand by the right. The modulus operator (%) returns the remainder of the left operand divided by the right.&lt;/p&gt;

&lt;h4&gt;
  
  
  Comparison Operators
&lt;/h4&gt;

&lt;p&gt;Comparison operators perform tests on their operands. They return the Boolean value true if the test is successful, or false otherwise.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight php"&gt;&lt;code&gt;&lt;span class="cp"&gt;&amp;lt;?php&lt;/span&gt; 
&lt;span class="c1"&gt;// == Represents "equivalent to"&lt;/span&gt;
&lt;span class="c1"&gt;// != Represents "not equivalent to"&lt;/span&gt;
&lt;span class="c1"&gt;// === Represents "identical to"&lt;/span&gt;
&lt;span class="c1"&gt;// !== Represents "not identical to"&lt;/span&gt;
&lt;span class="c1"&gt;// &amp;lt; Represents "less than"&lt;/span&gt;
&lt;span class="c1"&gt;// &amp;lt;= Represents "less than or equal to"&lt;/span&gt;
&lt;span class="c1"&gt;// &amp;gt; Represents "greater than"&lt;/span&gt;
&lt;span class="c1"&gt;// &amp;gt;= Represents "greater than or equal to"&lt;/span&gt;
&lt;span class="cp"&gt;?&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



</description>
      <category>php</category>
      <category>beginners</category>
      <category>webdev</category>
    </item>
    <item>
      <title>PHP for Beginners         (An Introduction)</title>
      <dc:creator>Afolabi Adekunle</dc:creator>
      <pubDate>Fri, 24 May 2019 17:59:07 +0000</pubDate>
      <link>https://dev.to/kluxury/php-for-beginners-an-introduction-off</link>
      <guid>https://dev.to/kluxury/php-for-beginners-an-introduction-off</guid>
      <description>&lt;h2&gt;
  
  
  Overview
&lt;/h2&gt;

&lt;p&gt;PHP (acronym for Hypertext preprocessor) is probably the most popular scripting language of the web. It is used to enhance web pages.&lt;/p&gt;

&lt;h2&gt;
  
  
  Web Architecture
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--29TOcKku--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/4mhnsg0dpid57yka1tnn.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--29TOcKku--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/4mhnsg0dpid57yka1tnn.jpg" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;The user access the website through the browser.&lt;/li&gt;
&lt;li&gt;The page is requested by the browser from the web server.&lt;/li&gt;
&lt;li&gt;Web server will collect the requested page( html,images and all etc.) from its document root.&lt;/li&gt;
&lt;li&gt;If it is a static element e.g html, css or JavaScript the response is returned directly to the browser and the browser renders it to User screen.&lt;/li&gt;
&lt;li&gt;Else if it is a PHP file the web server sends it content to the PHP interpreter which interpret and executes the code in the file. It also performs Database operation if required.&lt;/li&gt;
&lt;li&gt;PHP interpreter then generates output( if required) and sends it to the web server.&lt;/li&gt;
&lt;li&gt;Web server then sends the same to the browser which renders it to the User screen.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Origin of PHP
&lt;/h2&gt;

&lt;p&gt;It was created in 1944 by Rasmus Lerdorf for the purpose of tracking visits to his online resume, the collection of which he named Personal Home Page Tools.Its first incarnation was written in C programming language&lt;br&gt;
Over time more functionality was required which brought us to this present stage.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why Use PHP
&lt;/h2&gt;

&lt;p&gt;Open Source&lt;br&gt;
Free Download and Usage&lt;br&gt;
Wider Community of users&lt;br&gt;
Efficient running on the server&lt;/p&gt;

&lt;h2&gt;
  
  
  PHP Strengths
&lt;/h2&gt;

&lt;p&gt;Compared to Its contemporaries, PHP is easier to learn, more popular and has a wider audience than others.&lt;/p&gt;

&lt;h2&gt;
  
  
  PHP Contemporaries
&lt;/h2&gt;

&lt;p&gt;PHP is not the only scripting language that accesses database or the web server others include Perl, Java Server Page and Microsoft Asp.net to mention a few each of which has its own strength and weaknesses.&lt;/p&gt;

&lt;h2&gt;
  
  
  Availability
&lt;/h2&gt;

&lt;p&gt;PHP is available on multiple platforms e.g Windows, Linux, Unix, Mac OS etc.&lt;br&gt;
It is also compatible with almost all web server in use today e.g Apache and IIS.&lt;/p&gt;

&lt;h2&gt;
  
  
  Installing PHP as a module for Apache
&lt;/h2&gt;

&lt;p&gt;There are quite a few of softwares that come with PHP packages e.g Xampp Server and Wamp . It is advisable to check them all out to see what each has to offer before making your choice.&lt;/p&gt;

</description>
      <category>phpbackend</category>
    </item>
  </channel>
</rss>
