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

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 :: how to add properties to the request object 
Php :: php alert 
Php :: laravel env google smtp 
Php :: wordpress echo the page title 
Php :: how to hide .php extension using .htaccess 
Php :: php color echo 
Php :: laravel log permission denied mac 
Php :: blade switch 
Php :: php check if extension is installed 
Php :: pakistan time zone 
Php :: add action wp_footer 
Php :: Google_Service_Calendar Event Date Time 
Php :: mysql timestamp format php 
Php :: php validate phone number 
Php :: laravel migration set default value 
Php :: shuffle php function 
Php :: remove slashes from json php 
Php :: php if string is already in database 
Php :: CGST/SGST calculate in laravel 8 
Php :: laravel download file 
Php :: qual é a melhor linguagem de programação para iniciantes 
Php :: how to get the values of other fields in acf validate values 
Php :: how to get php version in xampp 
Php :: php mysqli number row 
Php :: wordpress get site url 
Php :: change php version in ubuntu 
Php :: twig create new array 
Php :: route group controller laravel 
Php :: laravel create table with model command line 
Php :: update query wordpress 
ADD CONTENT
Topic
Content
Source link
Name
2+7 =