Home > Article > Backend Development > Detailed introduction to string output
This article describes common string output methods in PHP. Share it with everyone for your reference, the details are as follows: 1. Echo usage: You can use echo to output directly, or you can use echo() to output, no return value $string="Bold display text";
echo $string;
//echo "
";
//echo($string);//The effect is the same as above
echo "
";
echo "This ", "is ", " echo test!";//echo outputs multiple strings separated by commas
echo "
";2. pri
1. Analysis of common string output methods in php (echo, print, printf and sprintf)
Introduction: This article mainly introduces the common string output methods in PHP, and analyzes echo, print, printf and sprintf in the form of examples. For the specific usage of output strings and related usage skills, friends in need can refer to
2. Easily process XML data in .NET Framework (4-1)
Introduction: XmlTextWriter class Creating XML documents using the methods in this section is obviously not difficult . For many years, developers have created XML documents by concatenating some strings in the cache, and then outputting the strings in the cache to a file...
3 . Python uses str & repr to convert strings
Introduction: str() is to convert a value into a string repr() is to convert an object into a string Do you understand the display: str() converts an object into a str object repr() visualizes an object and uses string output to allow programmers to see its internal structure
4. Interface specification issues
Introduction: The data returned by the interface generally outputs integers and floating point types as strings. Have you reviewed this type? Process it? How to deal with it? I am currently using the Laravel framework. My idea is to define the data type in each Model, and then process it uniformly when the Model is output. Is there anything good...
5. Put the database string output as html structure?
#Introduction: How can I turn the string stored in the database into an html element?
6. Function to control string output in PHP
Introduction::This article mainly introduces PHP The function that controls string output, students who are interested in PHP tutorials can refer to it.
Introduction: Convert the input parameter string waitForSignString into a binary array, and use UTF-8 for encoding (Java code such as: waitForSignString.getByte("utf-8")), get Binary format data of signature input parameters (waitForSignBytes). Use MD5, Sha1 or Sha256 algorithm to waitForSig...
8. [PHP source code reading]explode and implode functions explode out explode into explode
Introduction: explode, php source code: [PHP source code reading] explode and implode functions: The explode and implode functions are mainly used for string-array operations, such as obtaining a parameter and then based on a certain character Split a string, or combine the result of an array into a string output using one character. These two functions are often used in PHP, so it is necessary to understand their principles. explodearray explode ( string $delimiter, string $string, [ , $limit ] ) returns an array composed of strings, each element is st
9. explode and implode functionexplode implode cad explode php explode function
Introduction: explode:explode and implode functions: The explode and implode functions are mainly used for conversion operations between strings and arrays, such as splitting a string according to a certain character after obtaining a parameter, or converting the result of an array Use a character to combine into a string output. These two functions are often used in PHP, so it is necessary to understand their principles. explodearray explode ( string $delimiter, string $string, [ , $limit ]) function returns an array composed of strings, each element
10. Windows XP application skills PHP delimiter usage tips
Introduction: Windows XP application tips: Windows XP application tips PHP delimiter usage tips: If you use the traditional output method - press string When outputting, there must be a large number of escape characters to escape special characters such as quotation marks in the string to avoid syntax errors. If it is one or two places, it can be tolerated, but if it is a complete html text or a 200-line js, I think everyone will collapse. This is why PHP introduces a delimiter - at least a large part of the reason. 1. The function of the PHP delimiter is to output what is inside it as it is, including newline format and so on; 2. Any special characters in the PHP delimiter
【 Recommended related questions and answers]:
java stringwriter's flush() problem
java-ee - What is wrong with this java.nio example?
php - Output the database string as the html structure?
The above is the detailed content of Detailed introduction to string output. For more information, please follow other related articles on the PHP Chinese website!