1
0
mirror of https://github.com/restoreddev/phpapprentice.git synced 2025-08-02 04:50:34 +02:00

Merge pull request #17 from restoreddev/develop

Proofreading and home page edits
This commit is contained in:
Andrew
2018-12-26 19:18:38 -06:00
committed by GitHub
8 changed files with 18 additions and 13 deletions

View File

@@ -6,7 +6,6 @@
<title><?= $title ?? 'PHP Apprentice' ?></title> <title><?= $title ?? 'PHP Apprentice' ?></title>
<meta name="description" content="<?= $subtitle ?? 'A site for learning how to use PHP' ?>"> <meta name="description" content="<?= $subtitle ?? 'A site for learning how to use PHP' ?>">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="<?php echo asset('css/site.css') ?>"> <link rel="stylesheet" href="<?php echo asset('css/site.css') ?>">
<link rel="icon" href="/favicon-32.png"> <link rel="icon" href="/favicon-32.png">

View File

@@ -5,7 +5,7 @@
<div> <div>
<div class="home-title-wrapper"> <div class="home-title-wrapper">
<div class="home-logo"><?= icon('elephant') ?></div> <div class="home-logo"><?= icon('elephant') ?></div>
<h1 class="home-title">PHP Apprentice <em>(beta)</em></h1> <h1 class="home-title">PHP Apprentice</h1>
<h3 class="home-subtitle">A site for learning how to use PHP</h3> <h3 class="home-subtitle">A site for learning how to use PHP</h3>
</div> </div>
<p> <p>
@@ -15,10 +15,10 @@
The site currently has content for learning the basics of PHP. In the future, more pages will be added for more advanced topics like building websites, database integration and security. The site currently has content for learning the basics of PHP. In the future, more pages will be added for more advanced topics like building websites, database integration and security.
</p> </p>
<p> <p>
PHP Apprentice is currently a work in progress (hence "beta" is included in the title). If you would like to contribute or request a certain discussion topic, checkout the <a href="https://github.com/restoreddev/phpapprentice" target="_blank">GitHub repository</a>. PHP Apprentice is currently a work in progress. If you would like to contribute or request a certain discussion topic, checkout the <a href="https://github.com/restoreddev/phpapprentice" target="_blank">GitHub repository</a>.
</p> </p>
<p> <p>
To get started, you will need to <a href="<?php echo page_path('installing-php') ?>">install</a> PHP 7.1, have a text editor and open your terminal. To get started, you will need to <a href="<?php echo page_path('installing-php') ?>">install</a> PHP, have a text editor and open your terminal.
Each example in PHP Apprentice can by typed into a PHP file and executed in the terminal. Each example in PHP Apprentice can by typed into a PHP file and executed in the terminal.
Let's get started! 😃 Let's get started! 😃
</p> </p>

View File

@@ -5,10 +5,10 @@ $a = 1;
$b = 2; $b = 2;
// To add two values, use the plus symbol. // To add two values, use the plus symbol.
$c = $a + $b; echo $a + $b;
// To subtract, use the minus symbol. // To subtract, use the minus symbol.
$c = $b - $a; echo $b - $a;
// To multiply two values, use an asterisk. // To multiply two values, use an asterisk.
echo $a * $b; echo $a * $b;
@@ -18,8 +18,8 @@ echo $b / $a;
// PHP uses the percent symbol for calculating the modulus of two numbers. // PHP uses the percent symbol for calculating the modulus of two numbers.
// The modulus is calculated by dividing two numbers and returning the remainder of the result. // The modulus is calculated by dividing two numbers and returning the remainder of the result.
// So, in this example, the value of $modulo will be 0. // In this example, the value of $mod will be 0.
$modulo = 10 % 5; $mod = 10 % 5;
// You can also use double asterisks to calculate a number to the power of another number. // You can also use double asterisks to calculate a number to the power of another number.
// The following statement will print 25. // The following statement will print 25.

View File

@@ -14,7 +14,7 @@ $a && $b;
$a && $c; $a && $c;
// Using two pipe characters checks if either value is true. // Using two pipe characters checks if either value is true.
// Then, it will return true. If both values are false, the PHP // Then, it will return true. If both values are false, then PHP
// returns false. // returns false.
$a = true; $a = true;
$b = false; $b = false;

View File

@@ -2,7 +2,7 @@
// A boolean is a value that is always 0 or 1, yes or no, on or off. // A boolean is a value that is always 0 or 1, yes or no, on or off.
// In PHP, a boolean is represented by the words true and false. // In PHP, a boolean is represented by the words true and false.
// While programming, you will often want to know if something is true or false. // While programming, you will often want to know if something is positive or negative.
$a = true; $a = true;
$b = false; $b = false;
@@ -35,7 +35,13 @@ $one >= $two;
// by using three equal signs. // by using three equal signs.
// This returns true. // This returns true.
1 == 1;
1 == '1'; 1 == '1';
1 == true;
1 == 1.0;
1 === 1;
// This returns false. // This returns false.
1 === '1'; 1 === '1';
1 === true;
1 === 1.0;

View File

@@ -62,7 +62,7 @@ switch ($drink) {
$language = 'english'; $language = 'english';
echo $language == 'spanish' ? "hola\n" : "hello\n"; echo $language == 'spanish' ? "hola\n" : "hello\n";
// Lastly, there is another form of a ternary that checks if a value is set and then returns the value to the right of two question marks if value is null. // Lastly, there is another form of a ternary that checks if a value is set and then returns the value to the right of the two question marks if the value is null.
echo $IDoNotExist ?? "Variable not set\n"; echo $IDoNotExist ?? "Variable not set\n";
// You can also chain multiple checks in a row. // You can also chain multiple checks in a row.

View File

@@ -19,7 +19,7 @@ $var = 'I am a new variable';
// An int is a number without a decimal place. // An int is a number without a decimal place.
// A float is a number with a decimal place. // A float is a number with a decimal place.
// A boolean can be two values: true or false. // A boolean can be two values: true or false.
// Last, there is a string, a collection of characters. // Last, there is a string: a collection of characters.
$int = 1; $int = 1;
$float = 100.10; $float = 100.10;
$bool = true; $bool = true;

View File

@@ -146,7 +146,7 @@ return [
Page::create('abstract', null, 'abstract.php', [ Page::create('abstract', null, 'abstract.php', [
'title' => 'Abstract Classes', 'title' => 'Abstract Classes',
'subtitle' => 'Inheriting an interface', 'subtitle' => 'Inheriting an interface',
'previous' => 'interface', 'previous' => 'interfaces',
'next' => 'exceptions', 'next' => 'exceptions',
]), ]),
Page::create('exceptions', null, 'exceptions.php', [ Page::create('exceptions', null, 'exceptions.php', [