1
0
mirror of https://github.com/restoreddev/phpapprentice.git synced 2025-07-30 19:40:43 +02:00

Created initial site setup with hugo

This commit is contained in:
Andrew Davis
2019-07-12 19:21:18 -05:00
parent 77a0d2616b
commit e09557cf2c
80 changed files with 732 additions and 10488 deletions

31
content/04-strings.md Normal file
View File

@@ -0,0 +1,31 @@
As seen in the first chapter, a string is a group of characters created by
surrounding text in single or double quotes.
```php
<?php
$firstname = 'Joey';
$lastname = "Johnson";
```
A double quoted string can interpret special characters starting
with a back slash to create formatting. The `\n` creates a newline
between the names and after them.
```php
echo "Jacob\nJones\n";
```
Double quoted strings can also embed variables in the text. This code
outputs "Cindy Smith".
```php
$firstname = 'Cindy';
echo "$firstname Smith\n";
```
Another feature of strings is the ability to combine them together.
To combine two strings, use the period character in between them.
```php
$firstname = 'Jenny';
$lastname = 'Madison';
$fullname = $firstname . $lastname;
echo $fullname;
```