Search
 
SCRIPT & CODE EXAMPLE
 

PHP

php multiple line string

//use EOD function for multiple line variable
$variable=<<<EOD
  this is line1
  this is line2
  EOD;
Comment

multiline echo in php

<?php

$var = 'Howdy';

echo <<<EOL
This is output
And this is a new line
blah blah blah and this following $var will actually say Howdy as well

and now the output ends
EOL;
Comment

Write Multi-Line Strings in PHP

phpCopy<?php
$mystring1 = "This is the first line." . PHP_EOL;
$mystring2 = "This is the second line" . PHP_EOL;
$mystring3 = "This is the third line" . PHP_EOL;
$mystring4 = "This is the fourth line" . PHP_EOL;
$mystring5 = "This is the fifth line";
$mystring1 .= $mystring2 .= $mystring3 .= $mystring4 .= $mystring5;
echo($mystring1);
?>
Comment

Write Multi-Line Strings in PHP

phpCopy<?php
echo("This is the first line 

This is the third line");
?>
Comment

multiline string php

<?php
  $var_name=<<<MULTILINENAME
text
MULTILINENAME;
?>
Comment

Write Multi-Line Strings in PHP

phpCopy<?php
$mystring1 = "This is the first line." . PHP_EOL;
$mystring2 = "This is the second line";
$mystring1 .= $mystring2;
echo($mystring1);
?>
Comment

Write Multi-Line Strings in PHP

phpCopy<?php
echo("This is the first line 
This is the second line");
?>
Comment

Write Multi-Line Strings in PHP

phpCopy<?php
echo("This is the first line 
This is the third line");
?>
Comment

PREVIOUS NEXT
Code Example
Php :: laravel sanctum authentication 
Php :: how to delete a row in phpmyadmin 
Php :: polymorphism in php 
Php :: install laravel scout 
Php :: What was the old name of PHP? 
Php :: substr_count excact match php 
Php :: laravel blade @if 3 varabile 
Php :: php functions 
Php :: laravel excel 
Php :: get data from stdclass object php 
Php :: mail laravel 
Php :: create seed file from db laravel 
Php :: php is datetime 
Php :: move wordpress to new server 
Php :: redirect to codeigniter 4 
Php :: multiple value match in array php 
Php :: laravel validation rule 
Php :: API json data show in laravel 
Php :: notification in laravel 8 
Php :: laravel gate 
Php :: PHP Filters Advanced 
Php :: laravel htaccess to remove public from url 
Php :: PHP create array of specified size 
Php :: creating custom database 
Php :: htaccess rewriterule 
Php :: how to pass value in app.blade 
Php :: check not empty in laravel blade 
Php :: mysql php update sum same table 
Php :: IlluminateDatabaseEloquentMassAssignmentException with message 
Php :: How to hide tax details from woocommerce order emails 
ADD CONTENT
Topic
Content
Source link
Name
4+7 =