<?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: sannilincoln</title>
    <description>The latest articles on DEV Community by sannilincoln (@sannilincoln).</description>
    <link>https://dev.to/sannilincoln</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.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F172796%2F0e3a9b42-ff72-4ecd-a26c-3fffe9c47c42.jpeg</url>
      <title>DEV Community: sannilincoln</title>
      <link>https://dev.to/sannilincoln</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/sannilincoln"/>
    <language>en</language>
    <item>
      <title>Main differences between Web3 and web2</title>
      <dc:creator>sannilincoln</dc:creator>
      <pubDate>Sat, 05 Mar 2022 14:08:35 +0000</pubDate>
      <link>https://dev.to/sannilincoln/main-differences-between-web3-and-web2-2jbm</link>
      <guid>https://dev.to/sannilincoln/main-differences-between-web3-and-web2-2jbm</guid>
      <description>&lt;h2&gt;
  
  
  What is web2
&lt;/h2&gt;

&lt;p&gt;Web2 is the version of the internet we use today which provide interactivity, dynamism and also makes users to create content on the internet &lt;/p&gt;

&lt;h2&gt;
  
  
  What is web3
&lt;/h2&gt;

&lt;p&gt;Web3 according to wikipedia is an idea for a new iteration of the world wide web based on the blockchain technology which incorporates concept including decentralization and token-based economics.&lt;/p&gt;

&lt;h2&gt;
  
  
  Major Diffrences
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Architecture&lt;/strong&gt;: Web2 architecture is built on server-client architecture which is Centralized, i.e there is central server in which clients connects to for transactions. In Web3 the architecture is peer to peer (p2p) which is Decentralize. There is no central server and each computer has a copy of the data which they exchanged within their network.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Availability&lt;/strong&gt;: Due to its decentralized architecture, web3 servers can rarely go down beacause they have thousands of computers as their backend. While in Web2, shutdown of a major cloud provider can cause network outage of most web2 services.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Trustless&lt;/strong&gt;: Web3 allows participants to interact publicly or privately without any trusted  third party, while in web2, users needs to submit their personal data for them to interact with most platform.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Permisionless&lt;/strong&gt;: In Web3, neither users nor suppliers need  authorization from governing body for participating. in web2 authorization from governing body is required.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Payments&lt;/strong&gt;: Web3 Payment are buit in via native tokens such as ether(ETH).While Web2 payment payment still relies on the Fiat money.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;for more knowledge on web3 and blockchain technology, check out &lt;a href="//blockgames.gg"&gt;Blockgames&lt;/a&gt; for a gaming competition focusing on blockchain technology and how to leverage it for solving real life problems which is sponsored by &lt;a href="//nestcoin.com"&gt;Nestcoin&lt;/a&gt; and managed by &lt;a href="//Zuri.team"&gt;Zuri&lt;/a&gt;&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Iteration in PHP</title>
      <dc:creator>sannilincoln</dc:creator>
      <pubDate>Mon, 17 Jun 2019 12:31:57 +0000</pubDate>
      <link>https://dev.to/sannilincoln/iteration-in-php-3896</link>
      <guid>https://dev.to/sannilincoln/iteration-in-php-3896</guid>
      <description>&lt;p&gt;Most times when we write code, we usually want a block of code to run over and over again in a row. Instead of adding several almost equal lines of code-lines in a script, we can use loops to perform such a task.&lt;/p&gt;

&lt;h1&gt;
  
  
  The PHP while loop
&lt;/h1&gt;

&lt;p&gt;The while loop executes a block of code as long as the specified condition is true.&lt;/p&gt;

&lt;p&gt;the syntax is&lt;br&gt;
while (condition is true) {&lt;br&gt;
    code to be executed;&lt;br&gt;
}&lt;br&gt;
Example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$x = 1; 
while($x &amp;lt;= 5) {
    echo "The number is: $x &amp;lt;br&amp;gt;";
    $x++;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;The example above first sets a variable $x to 1 ($x = 1). Then, the while loop will continue to run as long as $x is less than, or equal to 5 ($x &amp;lt;= 5). $x will increase by 1 each time the loop runs ($x++):&lt;/p&gt;

&lt;h1&gt;
  
  
  The PHP do...while Loop
&lt;/h1&gt;

&lt;p&gt;The do...while loop will always execute the block of code once, it will then check the condition, and repeat the loop while the specified condition is true.&lt;br&gt;
The syntax is: &lt;br&gt;
do {&lt;br&gt;
    code to be executed;&lt;br&gt;
} while (condition is true);&lt;/p&gt;

&lt;p&gt;Example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$x = 1; 
do {
    echo "The number is: $x &amp;lt;br&amp;gt;";
    $x++;
} while ($x &amp;lt;= 5);
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;The example above first sets a variable $x to 1 ($x = 1). Then, the do while loop will write some output, and then increment the variable $x with 1. Then the condition is checked (is $x less than, or equal to 5?), and the loop will continue to run as long as $x is less than, or equal to 5.&lt;br&gt;
 We should note that in a do while loop the condition is tested AFTER executing the statements within the loop. This means that the do while loop would execute its statements at least once, even if the condition is false the first time.&lt;/p&gt;
&lt;h1&gt;
  
  
  PHP 7 for Loops
&lt;/h1&gt;

&lt;p&gt;The for loop is used when you know in advance how many times the script should run.&lt;br&gt;
 The syntax is:&lt;br&gt;
for (init counter; test counter; increment counter) {&lt;br&gt;
    code to be executed;&lt;br&gt;
}&lt;br&gt;
the parameters are:&lt;br&gt;
init counter: Initialize the loop counter value&lt;br&gt;
test counter: Evaluated for each loop iteration.If it evaluates to TRUE, the loop continues. If it evaluates to FALSE, the loop ends.&lt;br&gt;
increment counter: Increases the loop counter value.&lt;br&gt;
The example below displays the numbers from 1 to 10&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;for ($x = 1; $x &amp;lt;= 10; $x++) {
    echo "The number is: $x &amp;lt;br&amp;gt;" ;
}
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;h1&gt;
  
  
  The PHP foreach Loop
&lt;/h1&gt;

&lt;p&gt;The foreach loop works only on arrays and is used to loop through each key/value pair in an array.&lt;br&gt;
Syntax&lt;br&gt;
foreach ($array as $value) {&lt;br&gt;
    code to be executed;&lt;br&gt;
}&lt;br&gt;
For every loop iteration, the value of the current array element is assigned to $value and the array pointer is moved by one until it reaches the last array element.&lt;/p&gt;

&lt;p&gt;The following example demonstrates a loop that will output the values of the given array ($cars):&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$cars = array("toyota", "bmw", "ford", "lexus"); 
foreach ($cars as $value) {
    echo "$value &amp;lt;br&amp;gt;";
}
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;h1&gt;
  
  
  The PHP nested loop
&lt;/h1&gt;

&lt;p&gt;Php allows putting one loop inside another, this type of loop is known as a nested loop. A nested loop can be a forloop, while loop or even foreach loop. Syntax of a nested while-loop is:&lt;/p&gt;

&lt;p&gt;while(condition)&lt;br&gt;
{&lt;br&gt;
    while(condition)&lt;br&gt;
     {&lt;br&gt;
        statement(s);&lt;br&gt;
        increment/decrements;&lt;br&gt;
     }&lt;br&gt;
    statement(s);&lt;br&gt;
    increment/decrements;&lt;br&gt;
}&lt;/p&gt;

&lt;p&gt;an example is:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt; $i = 1 ;
 $j = 1;
while( $i &amp;lt; 3 )
{
    while( $j &amp;lt; 3 )
    {
        echo 'i love programming ';
        $j++;
    }
    echo '&amp;lt;br /&amp;gt;';
    $i++;
}
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;The syntax of a forloop nested loop is:&lt;/p&gt;

&lt;p&gt;for ( initialization; condition; increment/decrements )&lt;br&gt;
{&lt;br&gt;
   for ( initialization; condition; increment/decrements )&lt;br&gt;
   {&lt;br&gt;
      statement(s);&lt;br&gt;
   }&lt;br&gt;
   statement(s);&lt;br&gt;
}&lt;br&gt;
An example is:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt; $i ;
 $j;
for( $i=1; $i&amp;lt;3; $i++ )
{
   for( $j=1; $j&amp;lt;3; $j++)
   {
      echo 'i love php';
   }
   echo '&amp;lt;br/&amp;gt;';
}
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;The condition of the outer loop needs to be TRUE before the inner loop can run and more than two loops can be nested. &lt;/p&gt;

</description>
      <category>php</category>
      <category>todayilearned</category>
      <category>beginners</category>
    </item>
    <item>
      <title>Decision making in PHP.(module 3)</title>
      <dc:creator>sannilincoln</dc:creator>
      <pubDate>Tue, 11 Jun 2019 21:45:15 +0000</pubDate>
      <link>https://dev.to/sannilincoln/decision-making-in-php-module-3-ie9</link>
      <guid>https://dev.to/sannilincoln/decision-making-in-php-module-3-ie9</guid>
      <description>&lt;p&gt;Like most programming languages, PHP is built with conditional statements for making decision based on different conditions.&lt;br&gt;
   The if statements execute code if one condition is true. the syntax is &lt;br&gt;
if(condition){&lt;br&gt;
code to be executed;&lt;br&gt;
}&lt;br&gt;
The if statement is suitable when there is only one condition to be tested.&lt;/p&gt;

&lt;p&gt;The if else if statements execute code if a condition is true and if false another code is executed. the syntax is &lt;br&gt;
if(condition){&lt;br&gt;
code to be executed&lt;br&gt;
} else{&lt;br&gt;
    code to be executed;&lt;br&gt;
}&lt;br&gt;
It is suitable when there are only two conditions to be tested.&lt;br&gt;
 The nested if is used when the condition to be tested is more than two. the syntax is&lt;br&gt;
if (condition) {&lt;br&gt;
    code to be executed if this condition is true;&lt;br&gt;
} elseif (condition) {&lt;br&gt;
    code to be executed if the first condition is false and this condition is true;&lt;br&gt;
} else{&lt;br&gt;
    code to be executed if all conditions are false;&lt;br&gt;
}&lt;br&gt;
The switch case conditional statement is used to perform different actions based on different conditions. The switch statement selects one of many blocks of code to be executed. the syntax is &lt;br&gt;
switch (a) {&lt;br&gt;
    case label1:&lt;br&gt;
        code to be executed if a=label1;&lt;br&gt;
        break;&lt;br&gt;
    case label2:&lt;br&gt;
        code to be executed if a=label2;&lt;br&gt;
        break;&lt;br&gt;
    case label3:&lt;br&gt;
        code to be executed if a=label3;&lt;br&gt;
        break;&lt;br&gt;
    default:&lt;br&gt;
        code to be executed if a is different from all labels;&lt;br&gt;
}&lt;br&gt;
The first single expression (a) which is often a variable is evaluated once. then the value of the expression is then compared with the values for each case in the structure. If the value of the expression matches any one of the cases, the block of code associated with the code is executed. the break statement is used to prevent the code from running into the next case automatically. the code in the default statement is executed if there no match found.&lt;br&gt;
 The jump statements are keywords which are used in moderating the conditional statements wether to break, continue or exit the running of code. The break statement is usually used in loop or switch statement. The code will stop working if the condition is true.&lt;br&gt;
The continue statement skip the program execution and go to the next program. and the exit statement terminates the program's current execution flow.&lt;/p&gt;

</description>
    </item>
    <item>
      <title>PHP language building blocks</title>
      <dc:creator>sannilincoln</dc:creator>
      <pubDate>Sun, 02 Jun 2019 21:37:05 +0000</pubDate>
      <link>https://dev.to/sannilincoln/php-language-building-blocks-364n</link>
      <guid>https://dev.to/sannilincoln/php-language-building-blocks-364n</guid>
      <description>&lt;p&gt;In this article, I will walk you down on how to set up PHP, and the basic building blocks of PHP.&lt;br&gt;
PHP is widely preferred than other web scripting languges because:&lt;br&gt;
 #It runs on various platforms (Windows, Linux, Unix, Mac OS X, etc.).&lt;br&gt;
 #it is compatible with almost all servers used today (Apache, IIS, etc.). &lt;br&gt;
 #It supports a wide range of databases.&lt;br&gt;
 #It is free to use.&lt;br&gt;
 #It is easy to learn and runs efficiently on the server side.&lt;br&gt;
PHP can be installed using a software package called xampp which has an Apache server, database(MariaDB) and PHP itself. the software allows easy installation of PHP as the whole package needed to start PHP is being installed together. after installation, to start using PHP. you will launch xampp and run it as administrator(on windows). then the control panel dashboard would appear. then, you click on Apache and MySQL services to start running. next is to head over to your browser and type localhost on your address bar, this will take you to the xamp homepage by default, this shows everything is set. to start your own coding, head over to local drive(C drive), find a xamp folder and navigate to htdocs folder, and create your PHP file there e.g,(home.php). then head over to your browser and set the address to the name of the PHP file you created. e.g (localhost/home.php).&lt;br&gt;
PHP codes are wrapped in &amp;lt;?php and ?&amp;gt; these are symbols used in telling the compiler where the execution of the PHP code starts and stops. A PHP file, can contain an HTML code but you have to denote where your php code starts and where it ends using the PHP delimiters.&lt;br&gt;
  To initialize a variable in PHP, you have to start with the dollar sign $, then your variable name.php variable is case sensitive and must not start with a number or an underscore. Unlike other programming languages, PHP has no command for declaring a variable. It is created the moment you first assign a value to it.&lt;br&gt;
PHP, just as other web scripting language supports various data types such as:&lt;br&gt;
string: which is a sequence of characters, and is any text put inside double or single quotes.&lt;br&gt;
integer: integers are numbers without decimal and they are not put inside quotes, unlike strings. they can either be positive or negative.&lt;br&gt;
Float: is number with a decimal point or a number in exponential form.&lt;br&gt;
boolean: this data-type represent two possible states: TRUE OR FALSE.&lt;br&gt;
PHP also has data type such as arrays, objects and PHP Resource which stores reference information to functions and other resources which are external to php e.g database call.&lt;br&gt;
 PHP Constants are similar to a variable but they cannot be changed during the script. they are started with either letter or an underscore with no $ sign. to create a constant, the syntax is &lt;br&gt;
define(name,value,case-insensitive).&lt;br&gt;
name: name of the constant.&lt;br&gt;
value: value of the constant and last parameter is the boolean to indicate whether the case should be insensitive or not. The default is false. Php constants are global, which means they can be used across the entire script.&lt;br&gt;
 PHP has many operators which are used in performing operations based on variables and values.&lt;br&gt;
Arithmetic operators such as + - &lt;em&gt;/%&lt;/em&gt;* for  basic arithmetic operation. &lt;br&gt;
The assignment operator is used with numeric values to write a value to a variable. The basic assignment operator in PHP is "=". It means that the left operand gets set to the value of the assignment expression on the right e.g x=y, x+=y, etc.&lt;br&gt;
other operators include the comparison operator which returns  true if the condition is true and false if otherwise e.g equal (==), identical (===), &amp;lt;,&amp;gt;, etc, the incremental operator is used to increase or decrease variable value e.g ++,--, the logical operators are used to combine two conditional statements e.g and, or, xor,&amp;amp;&amp;amp; ||. we also have string operators e.g concatenation(.) and php array operators which are used to compare arrays e.g union (+), equality(==) and conditional operator which are used in setting value based on conditions e.g ternary operator(?:), Null coalescing(??). &lt;/p&gt;

</description>
      <category>php</category>
    </item>
    <item>
      <title>Getting started with PHP for web development</title>
      <dc:creator>sannilincoln</dc:creator>
      <pubDate>Tue, 28 May 2019 19:41:33 +0000</pubDate>
      <link>https://dev.to/sannilincoln/getting-started-with-php-for-web-development-5109</link>
      <guid>https://dev.to/sannilincoln/getting-started-with-php-for-web-development-5109</guid>
      <description>&lt;p&gt;PHP is a serverside scripting language, it is a very powerful language for making dynamic and interactive web pages. Php is free, robust and easy to learn for a beginner and it is supported most of the web servers. it is an efficient alternative to competitors like Microsoft's ASP.net and others. &lt;br&gt;
 To get started with PHP, it is expected you understand how the web works and the way the web page is structured and designed ( knowledge of Html &amp;amp; CSS). then to start using PHP, you can either find a web host on the web with PHP and MySQL support and start coding online or you can install a web server locally on your pc and then install PHP and MySQL on it. the later is easier to set-up as the whole package is bundled as Wamp  for windows OS or Xamp which is available on all Operating system (cross-platform)&lt;/p&gt;

</description>
      <category>php</category>
      <category>beginners</category>
    </item>
  </channel>
</rss>
