实例291:创建PHP 5.0新型字符串
这是一个字符串创建的实例
实例位置:光盘mingrisoft10291
实例说明
以往字符串的定义方式是将字符串用单引号或双引号括起来进行创建的,在PHP 5.0以后的版本中,出现了一种新型字符串的定义方式,本实例主要介绍如何创建这种新型字符串。
运行本实例,如图10.29所示,如果在页面中打印出“吉林省明日科技”,说明新型字符串创建成功。
图10.29 创建PHP 5.0新型字符串 |
技术要点
本实例的关键技术是如何创建这种新型字符串。这种字符串以“
字符串内容 //相当于"字符串内容"<br>标记;
实现过程
(1)创建PHP 5.0新型字符串。代码如下:
<?php <br>$str=吉林省明日科技<br>strmark;<br>echo $str;<br>?> |
(2)运行本实例,如果在浏览器中显示“吉林省明日科技”,说明程序创建成功。
举一反三
根据本实例,读者可以:
利用新型字符串创建邮件头和邮件体。
将HTML标记作为字符串内容,不经转义进行输出。

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

mPDF
mPDF is a PHP library that can generate PDF files from UTF-8 encoded HTML. The original author, Ian Back, wrote mPDF to output PDF files "on the fly" from his website and handle different languages. It is slower than original scripts like HTML2FPDF and produces larger files when using Unicode fonts, but supports CSS styles etc. and has a lot of enhancements. Supports almost all languages, including RTL (Arabic and Hebrew) and CJK (Chinese, Japanese and Korean). Supports nested block-level elements (such as P, DIV),

WebStorm Mac version
Useful JavaScript development tools

SAP NetWeaver Server Adapter for Eclipse
Integrate Eclipse with SAP NetWeaver application server.

Notepad++7.3.1
Easy-to-use and free code editor

VSCode Windows 64-bit Download
A free and powerful IDE editor launched by Microsoft
