str data type in php code example
Example 1: php data types
<?php
$x = "Hello world!";
echo $x;
$x = 5985;
var_dump($x);
$x = 10.365;
var_dump($x);
$x = true;
$y = false;
$cars = array("Volvo","BMW","Toyota");
var_dump($cars);
class Car {
function Car() {
$this->model = "VW";
}
}
$herbie = new Car();
echo $herbie->model;
$x = "Hello world!";
$x = null;
var_dump($x);
?>
Example 2: PHP strings
<?php
echo 'this is a simple string';
echo 'You can also have embedded newlines in
strings this way as it is
okay to do';
echo 'Arnold once said: "I\'ll be back"';
echo 'You deleted C:\\*.*?';
echo 'You deleted C:\*.*?';
echo 'This will not expand: \n a newline';
echo 'Variables do not $expand $either';
?>