Home  >  Article  >  Backend Development  >  What to do if a line in php is too long

What to do if a line in php is too long

藏色散人
藏色散人Original
2021-06-15 09:12:342360browse

If a line of php is too long, you can write it directly by carriage return and line feed, because in PHP, you can directly wrap the line without a connector; and in php, the code ends the statement with a semicolon.

What to do if a line in php is too long

The operating environment of this article: windows7 system, PHP7.1 version, DELL G3 computer

What should I do if a line of php is too long?

Press Enter directly, php ends the statement with a semicolon.

In PHP, you can directly wrap the line without a connector, as follows:

<?php
$requestPage = $_REQUEST[&#39;page&#39;];
if ("ipConfig" == $requestPage)
{
    $json = &#39;{
                "mac-address": "00:04:A3:22:18:FD",
                "host-name": "TRIAD",
                "dhcp-enable": "1",
                "ip-address": "192.168.200.40",
                "gateway": "192.168.200.254",
                "sub-mask": "255.255.255.0",
                "primary-dns": "192.168.200.2",
                "secondary-dns": "192.168.200.8"
             }&#39;;
}
echo $json;
?>

Recommended learning: "PHP Video Tutorial"

The above is the detailed content of What to do if a line in php is too long. For more information, please follow other related articles on the PHP Chinese website!

Statement:
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