mirror of
https://github.com/restoreddev/phpapprentice.git
synced 2025-08-03 13:27:35 +02:00
More proofreading and editing
This commit is contained in:
@@ -15,7 +15,7 @@
|
|||||||
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. 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, check out 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, 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.
|
||||||
|
@@ -1,6 +1,8 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
|
// In PHP, arrays are used to store a list of items in a single variable.
|
||||||
// There are two ways to create an array.
|
// There are two ways to create an array.
|
||||||
|
|
||||||
// First, you can use the array construct to pass in values separated by commas
|
// First, you can use the array construct to pass in values separated by commas
|
||||||
// and it will return an array.
|
// and it will return an array.
|
||||||
$taskList = array('grocery store', 'change car oil');
|
$taskList = array('grocery store', 'change car oil');
|
||||||
|
@@ -19,7 +19,7 @@ class Ballcap
|
|||||||
{
|
{
|
||||||
public $color;
|
public $color;
|
||||||
|
|
||||||
public function __construct($color )
|
public function __construct($color)
|
||||||
{
|
{
|
||||||
$this->color = $color;
|
$this->color = $color;
|
||||||
}
|
}
|
||||||
|
@@ -20,7 +20,7 @@ $processor = new Processor();
|
|||||||
$processor->charge('1234');
|
$processor->charge('1234');
|
||||||
|
|
||||||
// A developer who wants to prevent an exception from stopping code execution
|
// A developer who wants to prevent an exception from stopping code execution
|
||||||
// can catch the exception and use it for logging or a return an error to a user.
|
// can catch the exception and use it for logging or display the error to a user.
|
||||||
|
|
||||||
// Just wrap the code that might throw an exception with the keyword "try" and brackets
|
// Just wrap the code that might throw an exception with the keyword "try" and brackets
|
||||||
// followed by "catch", the exception type in parentheses and more brackets.
|
// followed by "catch", the exception type in parentheses and more brackets.
|
||||||
|
Reference in New Issue
Block a user