


Analysis of common string output methods in PHP (echo, print, printf and sprintf)
Jan 21, 2017 pm 01:23 PM本文讲述了php常用字符串输出方法。分享给大家共大家参考,具体如下:
1. echo用法:可用echo 直接输出,也可以用echo()输出,无返回值
1 2 3 4 5 6 7 |
|
2. print用法:同上echo一样,只是print运行速度比echo慢,且一次只能输出一个字符串,始终返回1
1 2 3 4 5 |
|
3. printf:格式化输出字符串
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
|
4. sprintf:
1 2 3 4 |
|
希望本文所述对大家php程序设计有所帮助。
更多php常用字符串输出方法分析(echo,print,printf及sprintf) 相关文章请关注PHP中文网!

Hot Article

Hot tools Tags

Hot Article

Hot Article Tags

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

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics

11 Best PHP URL Shortener Scripts (Free and Premium)

Working with Flash Session Data in Laravel

Build a React App With a Laravel Back End: Part 2, React

Simplified HTTP Response Mocking in Laravel Tests

cURL in PHP: How to Use the PHP cURL Extension in REST APIs

12 Best PHP Chat Scripts on CodeCanyon

Announcement of 2025 PHP Situation Survey
