10 Course recommendations for the PHP Echo () function

Source: Internet
Author: User
Tags echo command learn php
Suppose there is an array: <?php$arr=["php", "Chinese", "net"];echo $arr; > What will the above code output? Above results you can try again locally. We generally use Print_r to print an array (of course with var_dump, but not structurally clear) bool Print_r (mixed $expression [, BOOL $return]) Try printing print_r ($names); When the second argument is true, Print_r does not print the array directly, but instead returns the printed content as a string with echo Print_r ($names, true); we can use Echo to print a string, integer, float, but we can't use it to

1.10 ways to print an array

Introduction: Suppose there is an array: &lt;? php$arr=[&quot; php&quot;,&quot; Chinese &quot;,&quot; Net &quot;]; echo&nbsp; $arr;? &gt; What will the above code output? Above results you can try again locally. We generally use Print_r to print arrays (of course with var_dump, but not structurally clear) bool&nbsp;print_r&nbsp; (&nbsp;mixe ...

2. About PHP sprintf () functions 10 articles recommended

Introduction: This article summarizes 7 kinds of PHP commonly used print output functions, respectively, Echo,print,printf,sprintf,print_r,var_dump,die, I hope we can help you learn PHP This article has been to learn all the functions in PHP for output information, classification comparison to learn the same points and different points, master the necessary skills in daily development. Development will need to debug code, and PHP debugging code can not be like iOS that compiler language through the development software such as Xcode to single-step debugging, ...

3. About PHP substr () functions 10 articles recommended

Introduction: This article describes the use of string length interception in PHP. Share to everyone for reference, as follows: PHP provides a lot of use of functions, where the interception function of the string is no exception, and the function is very powerful. &lt;? php//file encoding format for utf-8$str=& #39; on the park boat, there is a pretty girl, if something happens in the center of the lake what ......& #39;; Echo&nbsp;mb_substr ($str,0,7,& #39; utf-8& #39;) and/or set up here ...

4. A detailed introduction to the SUBSTR function

Introduction: This article describes the use of string length interception in PHP. Share to everyone for reference, as follows: PHP provides a lot of use of functions, where the interception function of the string is no exception, and the function is very powerful. &lt;? php//file encoding format for utf-8$str=& #39; on the park boat, there is a pretty girl, if something happens in the center of the lake what ......& #39;; Echo&nbsp;mb_substr ($str,0,7,& #39; utf-8& #39;) and/or set up here ...

5. Tutorial on using the Echo command in Linux

Introduction: The Echo command of Linux is very common in shell programming, it is often used when printing variable value under terminal, so it is necessary to understand the use of echo below, this article mainly introduces the use of Echo command in Linux, A friend you need can refer to learning.

6. Types of PHP functions and methods of invocation

Summary: In PHP, the use of functions is very flexible, but anyway, the function, in the final analysis, is still a processing process. At the same time, there must be a return value, in order to let the user perceive its existence, but also its value! Therefore, the function is always used as a value, so it cannot appear to the left of the equals sign ' = ', which is the biggest difference between the function and the language structure. For example, we often say that echo () and list () is a language structure, not a function, although it looks like a function, because they can be placed on the left side of the equal sign, can accept the assignment. And the function is not. Hope this article, let you have a deeper understanding of the function ~ ~

7. Magic Method ___tostring () Example (PHP Object-oriented Advanced tutorial)

Summary: As we all know, after we instantiate a class, accessing the properties of a class is accessed in such a format as the name of the property named-----so do you use the Echo or print output object directly? Some people say, this should be not possible, will error it. Yes, this direct output does make an error, but when we use the Magic method to __tostring it. Example Analysis: <?php

8. PHP output array-print array instance in detail

Summary: The output of an array element in PHP can be achieved through output statements, such as ECHO statements, print statements, and so on. However, this output can only be used to output an element in an array, and the Print_r () function allows you to output the structure of the arrays.

9. Objects that parse the PHP data type (object)

Summary: Object initialization to create a new object, instantiate a class using the new statement: <?phpclassfoo{Functiondo_foo () {echo

10. Detailed introduction of PHP printout function summary

Introduction: This article gives you a summary of 7 kinds of PHP commonly used print output functions, respectively, is Echo,print,printf,sprintf,print_r,var_dump,die, I hope to learn PHP can help you

"Related question and answer recommendation":

Php-typecho archive page How to page out

Linux-crontab cannot automatically execute scripts

Linux-how to simplify processing path substitution

MySQL-Maximum number of database connections Typecho can run

Java-shell Script Run issues

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.