Home > Backend Development > PHP Problem > what does php pre mean

what does php pre mean

藏色散人
Release: 2023-03-14 07:44:01
Original
3269 people have browsed it

php pre is a pre-typesetting mark, which is mainly used to maintain the uniformity of the format when outputting error codes or printing array output.

what does php pre mean

#The operating environment of this article: Windows7 system, PHP7.1, Dell G3.

php What does pre mean?

 
Copy after login
is an html tag, which means output as it is without changes.

Pre is mainly used in PHP code to output error codes, or to print array output to maintain the uniformity of the format.

For example:

<pre class="brush:php;toolbar:false">
<?php
$cars=array(
    array("aaa",1,20),
    array("bbb",2,30),
    array("ccc",3,40),
);
print_r($cars);
?>
Copy after login

what does php pre mean

Extended information

Tips for using html tag pre in PHP debugging:

In debugging In PHP programs, we often print information to view. The print_r function can be very convenient for printing array contents, but when printed, it is not indented according to the format, which seems very inconvenient.

A little trick is to use the pre tag, such as:

<pre class="brush:php;toolbar:false"><?php print_r($tempArr)?>
Copy after login

Example code:

1,'b'=>2,'c'=>array(1,2,3));
?>
<pre class="brush:php;toolbar:false"><?php print_r($tempArr)?>
Copy after login

The page is displayed as follows:

Array
[a] => 1
[b] => 2
[c] => Array
(
[0] => 1
[1] => 2
[2] => 3
)
)
Copy after login

Recommended study: " PHP video tutorial

The above is the detailed content of what does php pre mean. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
php
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Issues
php data acquisition?
From 1970-01-01 08:00:00
0
0
0
PHP extension intl
From 1970-01-01 08:00:00
0
0
0
How to learn php well
From 1970-01-01 08:00:00
0
0
0
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template