Search
 
SCRIPT & CODE EXAMPLE
 

PHP

php syntax <<<


<?php
$str = <<<EOD
Example of string
spanning multiple lines
using heredoc syntax.
EOD;

/* More complex example, with variables. */
class foo
{
    var $foo;
    var $bar;

    function __construct()
    {
        $this->foo = 'Foo';
        $this->bar = array('Bar1', 'Bar2', 'Bar3');
    }
}

$foo = new foo();
$name = 'MyName';

echo <<<EOT
My name is "$name". I am printing some $foo->foo.
Now, I am printing some {$foo->bar[1]}.
This should print a capital 'A': x41
EOT;
?>

Comment

PREVIOUS NEXT
Code Example
Php :: twig filter line break 
Php :: return back in blade laravel 
Php :: laravel group routes 
Php :: count remaining days php 
Php :: laravel where not 
Php :: wp logs 
Php :: laravel required_with 
Php :: php for loop array 
Php :: date and time in php 
Php :: phpspreadsheet middle align 
Php :: laravel model casts 
Php :: get woocommerce order details 
Php :: how to change existing migration laravel 
Php :: laravel foreach first 
Php :: PHP Create a MySQL Database 
Php :: How to get a WordPress post by slug 
Php :: blade if 
Php :: laravel multiple where conditions 
Php :: PHP (WordPress) - Increase Maximum Upload File Size 
Php :: @include laravel 
Php :: populate old value of dropdown laravel 
Php :: laravel remove foreign key 
Php :: wp redirect 
Php :: file put contents append 
Php :: php get ip client 
Php :: using php, how to create a folder in another folder 
Php :: nested resources laravel 
Php :: if notexists in laravel query 
Php :: Line : 83 -- syntax error, unexpected end of file php 
Php :: get process id php 
ADD CONTENT
Topic
Content
Source link
Name
3+1 =