Veronica's code output for Strings:
Strings
Hello WorldHelloWorld
3
3
 
<?php
include('includes/header.php');
// code
error_reporting(E_ALL); // set error reporting to all
echo("<h1>Veronica's code output for Strings:</h1>");
echo('<h2>Strings</h2>');
$a = 'Hello';
$b = 'World';
echo("$a $b");
echo('<br>');
$a = 'Hello';
$b = 'World';
$c = $a . $b; // <-- note $a . $b
echo($c);
echo('<br>');
$a = 'Hello1';
$b = 'World2';
//$c = $a + $b; // <-- note $a + $b will cause error, page will end here
$c = str_replace($a, 'Hello1', 1) + str_replace($b, 'World2', 2); // <-- try this
echo($c);
echo('<br>');
$a = '1Hello';
$b = '2World';
//$c = $a + $b; // <-- note $a + $b will cause error, page will end here
$c = substr($a, 0) + substr($b, 0); // <-- try this
echo($c);
echo('<br>');
include('includes/footer.php');
?>