| Start |
|---|
| echo and print
Shorthand notation for |
Outputting a structured view of arrays and objects |
| String concatenation with echo You can use concatenation to join strings (opens new window) "end to end" while outputting them (with You can concatenate variables using a Similar to concatenation, String concatenation vs passing multiple arguments to echoPassing multiple arguments to the echo command is more advantageous than string concatenation in some circumstances. The arguments are written to the output in the same order as they are passed in. The problem with the concatenation is that the period |
| printf vs sprintf
It is also possible to format a number with these 2 functions. This can be used to format a decimal value used to represent money so that it always has 2 decimal digits. The two functions |
| Outputting large integers On 32-bits systems, integers larger than Note: watch out for float precision, which is not infinite! While this looks nice, in this contrived example the numbers can all be represented as a binary number since they are all powers of 1024 (and thus 2). See for example: |
Output a Multidimensional Array with index and value and print into the table Output Multidimensional Array with index and value in table RemarksVariables in PHP come in a variety of types. Depending on the use case, you may want to output them to the browser as rendered HTML, output them for debugging, or output them to the terminal (if running an application via the command line). Below are some of the most commonly used methods and language constructs to output variables:
Note: When trying to output an object as a string, PHP will try to convert it into a string (by calling |
Read Article
https://develop.horje.com/learn/1434/reference