Heim Backend-Entwicklung PHP-Tutorial php 打印、显示、输出函数 收集_PHP教程

php 打印、显示、输出函数 收集_PHP教程

Jul 13, 2016 pm 05:37 PM
echo php this world 函数 打印 sammeln 显示 输出

<span style="color: rgb(0,0,0)"><font face="NSimsun"><span style="color: rgb(0,0,187)"><?php <br /> </span><span style="color: rgb(0,119,0)">echo </span><span style="color: rgb(221,0,0)">"Hello World"</span></font><span style="color: rgb(0,119,0)"><font face="NSimsun">;<br> <br> echo </font></span><span style="color: rgb(221,0,0)"><font face="NSimsun">"This spans<br> multiple lines. The newlines will be<br> output as well"</font></span><font face="NSimsun"><span style="color: rgb(0,119,0)">;<br> <br> echo </span><span style="color: rgb(221,0,0)">"This spans multiple lines. The newlines will be output as well."</span></font><font face="NSimsun"><span style="color: rgb(0,119,0)">;<br> <br> echo </span><span style="color: rgb(221,0,0)">"Escaping characters is done "Like this"."</span></font><span style="color: rgb(0,119,0)"><font face="NSimsun">;<br> <br> </font></span><font face="NSimsun"><span style="color: rgb(255,128,0)">// You can use variables inside of an echo statement<br> </span><span style="color: rgb(0,0,187)">$foo </span><span style="color: rgb(0,119,0)">= </span><span style="color: rgb(221,0,0)">"foobar"</span></font><font face="NSimsun"><span style="color: rgb(0,119,0)">;<br> </span><span style="color: rgb(0,0,187)">$bar </span><span style="color: rgb(0,119,0)">= </span><span style="color: rgb(221,0,0)">"barbaz"</span></font><font face="NSimsun"><span style="color: rgb(0,119,0)">;<br> <br> echo </span><span style="color: rgb(221,0,0)">"foo is </span><span style="color: rgb(0,0,187)">$foo</span><span style="color: rgb(221,0,0)">"</span><span style="color: rgb(0,119,0)">; </span></font><font face="NSimsun"><span style="color: rgb(255,128,0)">// foo is foobar<br> <br> // You can also use arrays<br> </span><span style="color: rgb(0,0,187)">$baz </span><span style="color: rgb(0,119,0)">= array(</span><span style="color: rgb(221,0,0)">"value" </span><span style="color: rgb(0,119,0)">=> </span><span style="color: rgb(221,0,0)">"foo"</span></font><font face="NSimsun"><span style="color: rgb(0,119,0)">);<br> <br> echo </span><span style="color: rgb(221,0,0)">"this is </span><span style="color: rgb(0,119,0)">{</span><span style="color: rgb(0,0,187)">$baz</span><span style="color: rgb(0,119,0)">[</span><span style="color: rgb(221,0,0)">value</span><span style="color: rgb(0,119,0)">]}</span><span style="color: rgb(221,0,0)"> !"</span><span style="color: rgb(0,119,0)">; </span></font><font face="NSimsun"><span style="color: rgb(255,128,0)">// this is foo !<br> <br> // Using single quotes will print the variable name, not the value<br> </span><span style="color: rgb(0,119,0)">echo </span><span style="color: rgb(221,0,0)">foo is $foo</span><span style="color: rgb(0,119,0)">; </span></font><font face="NSimsun"><span style="color: rgb(255,128,0)">// foo is $foo<br> <br> // If you are not using any other characters, you can just echo variables<br> </span><span style="color: rgb(0,119,0)">echo </span><span style="color: rgb(0,0,187)">$foo</span><span style="color: rgb(0,119,0)">;          </span></font><font face="NSimsun"><span style="color: rgb(255,128,0)">// foobar<br> </span><span style="color: rgb(0,119,0)">echo </span><span style="color: rgb(0,0,187)">$foo</span><span style="color: rgb(0,119,0)">,</span><span style="color: rgb(0,0,187)">$bar</span><span style="color: rgb(0,119,0)">;     </span></font><font face="NSimsun"><span style="color: rgb(255,128,0)">// foobarbarbaz<br> <br> // Some people prefer passing multiple parameters to echo over concatenation.<br> </span><span style="color: rgb(0,119,0)">echo </span><span style="color: rgb(221,0,0)">This </span><span style="color: rgb(0,119,0)">, </span><span style="color: rgb(221,0,0)">string </span><span style="color: rgb(0,119,0)">, </span><span style="color: rgb(221,0,0)">was </span><span style="color: rgb(0,119,0)">, </span><span style="color: rgb(221,0,0)">made </span><span style="color: rgb(0,119,0)">, </span><span style="color: rgb(221,0,0)">with multiple parameters.</span><span style="color: rgb(0,119,0)">, </span><span style="color: rgb(0,0,187)">chr</span><span style="color: rgb(0,119,0)">(</span><span style="color: rgb(0,0,187)">10</span></font><font face="NSimsun"><span style="color: rgb(0,119,0)">);<br> echo </span><span style="color: rgb(221,0,0)">This </span><span style="color: rgb(0,119,0)">. </span><span style="color: rgb(221,0,0)">string </span><span style="color: rgb(0,119,0)">. </span><span style="color: rgb(221,0,0)">was </span><span style="color: rgb(0,119,0)">. </span><span style="color: rgb(221,0,0)">made </span><span style="color: rgb(0,119,0)">. </span><span style="color: rgb(221,0,0)">with concatenation. </span><span style="color: rgb(0,119,0)">. </span><span style="color: rgb(221,0,0)">" "</span></font><span style="color: rgb(0,119,0)"><font face="NSimsun">;<br> <br> echo </font></span><font face="NSimsun"><span style="color: rgb(221,0,0)">This uses the "here document" syntax to output<br> multiple lines with </span><span style="color: rgb(0,0,187)">$variable</span></font><span style="color: rgb(221,0,0)"><font face="NSimsun"> interpolation. Note<br> that the here document terminator must appear on a<br> line with just a semicolon. no extra whitespace!<br> </font></span><span style="color: rgb(0,119,0)"><font face="NSimsun">END;<br> <br> </font></span><font face="NSimsun"><span style="color: rgb(255,128,0)">// Because echo does not behave like a function, the following code is invalid.<br> </span><span style="color: rgb(0,119,0)">(</span><span style="color: rgb(0,0,187)">$some_var</span><span style="color: rgb(0,119,0)">) ? echo </span><span style="color: rgb(221,0,0)">true </span><span style="color: rgb(0,119,0)">: echo </span><span style="color: rgb(221,0,0)">false</span></font><span style="color: rgb(0,119,0)"><font face="NSimsun">;<br> <br> </font></span><font face="NSimsun"><span style="color: rgb(255,128,0)">// However, the following examples will work:<br> </span><span style="color: rgb(0,119,0)">(</span><span style="color: rgb(0,0,187)">$some_var</span><span style="color: rgb(0,119,0)">) ? print </span><span style="color: rgb(221,0,0)">true </span><span style="color: rgb(0,119,0)">: print </span><span style="color: rgb(221,0,0)">false</span><span style="color: rgb(0,119,0)">; </span></font><font face="NSimsun"><span style="color: rgb(255,128,0)">// print is also a construct, but<br>                                              // it behaves like a function, so<br>                                              // it may be used in this context.<br> </span><span style="color: rgb(0,119,0)">echo </span><span style="color: rgb(0,0,187)">$some_var </span><span style="color: rgb(0,119,0)">? </span><span style="color: rgb(221,0,0)">true</span><span style="color: rgb(0,119,0)">: </span><span style="color: rgb(221,0,0)">false</span><span style="color: rgb(0,119,0)">; </span></font><font face="NSimsun"><span style="color: rgb(255,128,0)">// changing the statement around<br> </span><span style="color: rgb(0,0,187)">?></span> </font></span>


====================
PHP die() 函数

www.bkjia.comtruehttp://www.bkjia.com/PHPjc/486540.htmlTechArticle?php echo Hello World ; echo This spans multiple lines. The newlines will be output as well ; echo This spansmultiple lines. The newlines will beoutput as well. ; echo Escaping cha...
Erklärung dieser Website
Der Inhalt dieses Artikels wird freiwillig von Internetnutzern beigesteuert und das Urheberrecht liegt beim ursprünglichen Autor. Diese Website übernimmt keine entsprechende rechtliche Verantwortung. Wenn Sie Inhalte finden, bei denen der Verdacht eines Plagiats oder einer Rechtsverletzung besteht, wenden Sie sich bitte an admin@php.cn

Heiße KI -Werkzeuge

Undresser.AI Undress

Undresser.AI Undress

KI-gestützte App zum Erstellen realistischer Aktfotos

AI Clothes Remover

AI Clothes Remover

Online-KI-Tool zum Entfernen von Kleidung aus Fotos.

Undress AI Tool

Undress AI Tool

Ausziehbilder kostenlos

Clothoff.io

Clothoff.io

KI-Kleiderentferner

AI Hentai Generator

AI Hentai Generator

Erstellen Sie kostenlos Ai Hentai.

Heißer Artikel

R.E.P.O. Energiekristalle erklärten und was sie tun (gelber Kristall)
2 Wochen vor By 尊渡假赌尊渡假赌尊渡假赌
Repo: Wie man Teamkollegen wiederbelebt
4 Wochen vor By 尊渡假赌尊渡假赌尊渡假赌
Hello Kitty Island Abenteuer: Wie man riesige Samen bekommt
4 Wochen vor By 尊渡假赌尊渡假赌尊渡假赌

Heiße Werkzeuge

Notepad++7.3.1

Notepad++7.3.1

Einfach zu bedienender und kostenloser Code-Editor

SublimeText3 chinesische Version

SublimeText3 chinesische Version

Chinesische Version, sehr einfach zu bedienen

Senden Sie Studio 13.0.1

Senden Sie Studio 13.0.1

Leistungsstarke integrierte PHP-Entwicklungsumgebung

Dreamweaver CS6

Dreamweaver CS6

Visuelle Webentwicklungstools

SublimeText3 Mac-Version

SublimeText3 Mac-Version

Codebearbeitungssoftware auf Gottesniveau (SublimeText3)

CakePHP-Projektkonfiguration CakePHP-Projektkonfiguration Sep 10, 2024 pm 05:25 PM

In diesem Kapitel werden wir die Umgebungsvariablen, die allgemeine Konfiguration, die Datenbankkonfiguration und die E-Mail-Konfiguration in CakePHP verstehen.

PHP 8.4 Installations- und Upgrade-Anleitung für Ubuntu und Debian PHP 8.4 Installations- und Upgrade-Anleitung für Ubuntu und Debian Dec 24, 2024 pm 04:42 PM

PHP 8.4 bringt mehrere neue Funktionen, Sicherheitsverbesserungen und Leistungsverbesserungen mit einer beträchtlichen Menge an veralteten und entfernten Funktionen. In dieser Anleitung wird erklärt, wie Sie PHP 8.4 installieren oder auf PHP 8.4 auf Ubuntu, Debian oder deren Derivaten aktualisieren. Obwohl es möglich ist, PHP aus dem Quellcode zu kompilieren, ist die Installation aus einem APT-Repository wie unten erläutert oft schneller und sicherer, da diese Repositorys in Zukunft die neuesten Fehlerbehebungen und Sicherheitsupdates bereitstellen.

CakePHP Datum und Uhrzeit CakePHP Datum und Uhrzeit Sep 10, 2024 pm 05:27 PM

Um in cakephp4 mit Datum und Uhrzeit zu arbeiten, verwenden wir die verfügbare FrozenTime-Klasse.

CakePHP-Datei hochladen CakePHP-Datei hochladen Sep 10, 2024 pm 05:27 PM

Um am Datei-Upload zu arbeiten, verwenden wir den Formular-Helfer. Hier ist ein Beispiel für den Datei-Upload.

CakePHP-Routing CakePHP-Routing Sep 10, 2024 pm 05:25 PM

In diesem Kapitel lernen wir die folgenden Themen im Zusammenhang mit dem Routing kennen.

Besprechen Sie CakePHP Besprechen Sie CakePHP Sep 10, 2024 pm 05:28 PM

CakePHP ist ein Open-Source-Framework für PHP. Es soll die Entwicklung, Bereitstellung und Wartung von Anwendungen erheblich vereinfachen. CakePHP basiert auf einer MVC-ähnlichen Architektur, die sowohl leistungsstark als auch leicht zu verstehen ist. Modelle, Ansichten und Controller gu

So richten Sie Visual Studio-Code (VS-Code) für die PHP-Entwicklung ein So richten Sie Visual Studio-Code (VS-Code) für die PHP-Entwicklung ein Dec 20, 2024 am 11:31 AM

Visual Studio Code, auch bekannt als VS Code, ist ein kostenloser Quellcode-Editor – oder eine integrierte Entwicklungsumgebung (IDE) –, die für alle gängigen Betriebssysteme verfügbar ist. Mit einer großen Sammlung von Erweiterungen für viele Programmiersprachen kann VS Code c

CakePHP erstellt Validatoren CakePHP erstellt Validatoren Sep 10, 2024 pm 05:26 PM

Der Validator kann durch Hinzufügen der folgenden zwei Zeilen im Controller erstellt werden.

See all articles