php 文本格式化_格式化PHP文本
php 文本格式化
So you’ve gone through the PHP tutorials or are new to PHP in general, and you can make some nifty things in PHP, but they all look like plain text. How do you jazz them up?
因此,您已经遍历了PHP 教程或者是PHP的新手 ,并且可以在PHP中做一些漂亮的事情,但它们看起来都像纯文本。 你如何爵士他们?
Formatting PHP text isn’t done with PHP; it’s done with HTML. You can do this in two ways. You can add HTML inside the PHP code or you can add the PHP code inside the HTML. Either way, the file must be saved as a .php or another file type that is allowed to execute PHP on your server.
使用PHP不能格式化PHP文本; 它是用HTML完成的。 您可以通过两种方式执行此操作。 您可以在PHP代码内部添加HTML,也可以在HTML内部添加PHP代码。 无论哪种方式,文件都必须另存为.php或允许在服务器上执行PHP的其他文件类型。
在PHP内部使用HTML更改PHP文本颜色 ( Changing PHP Text Color Using HTML Inside PHP )
For example, to change the PHP text color to red.
例如,将PHP文本颜色更改为红色。
Hello World!";
?>
In this case, the hex color number #ff0000 sets the PHP text that follows it to red. The number could be replaced by other hex color numbers for other colors. Notice the HTML code is located inside the echo.
在这种情况下,十六进制颜色数字#ff0000会将其后PHP文本设置为红色。 该数字可以用其他颜色的其他十六进制颜色数字代替。 请注意,HTML代码位于回显内。
使用PHP Inside HTML更改PHP文本颜色 ( Changing PHP Text Color Using PHP Inside HTML )
The same effect is achieved with the following code, which uses PHP inside HTML.
下面的代码在HTML内使用PHP达到了相同的效果。
In the second example, a single line of PHP is inserted inside the HTML. Although here it is only a line to make the text red in this example, it could be inside a fully formatted HTML page to get any look you want.
在第二个示例中,在HTML内插入了一行PHP。 尽管在此示例中仅使文本变成红色,但它仍可以位于完全格式化HTML页面内,以获取所需的外观。
HTML中可用的格式类型 ( Types of Formatting Available in HTML )
It is easy to make text formatting changes to PHP text inside HTML. Although many of these formatting commands have been suspended in Cascading Style Sheets, they all still work in HTML. Some of the text formatting commands that can be used include:
可以很容易地将HTML中的文本格式更改为PHP文本。 尽管其中许多格式化命令已在“层叠样式表”中挂起,但它们仍然可以在HTML中使用。 可以使用的一些文本格式命令包括:
Bold -
胆大 -
Italic -
斜体-
Underline -
下划线-
Strike-out - or
淘汰赛-或
Small -
小-
Font size - , replace the ? with a number from 1 to 7, 1 being the smallest
字体大小-替换? 从1到7的数字是最小的
Center text -
中心文字-
A complete list of text formatting tags is available.
提供了文本格式标记的完整列表。
翻译自: https://www.thoughtco.com/formatting-your-php-2693945
php 文本格式化
还没有评论,来说两句吧...