初涉s h e l l的用户常常会遇到的一个问题就是如何把双引号包含到e c h o命令的字符串中.引号是一个特殊字符,所以必须要使用反斜杠\来使s h e l l忽略它的特殊含义.假设你希望使用e c h o命令输出这样的字符串:“/ d e v / r m t 0”,那么我们只要在引号前面加上反斜杠\即可: $ echo "\"/dev/rmt0"\" 输出 " / d e v / r m t 0 "
为什么要对字符串编码? 某些字符串中包含html标签,不编码,页面输出就乱了. PHP下怎么对字符串编码? htmlentities vs htmlspecialchars htmlentities 与htmlspecialchar 区别: htmlentities is identical to htmlspecialchars() in all ways, except with htmlentities(), all characters which have HTML character
PHP代码可以出现在Web Page的任何位置,甚至在HTML的标签里面也可以.有4中方式在Web Page中包含PHP代码: 使用<?php ... ?>标签 <!doctype html> <html> <head> <title>This is my first PHP program!</title> </head> <body> <p> Look, ma! It's my first PH