Home > Article > Backend Development > What to do if a line in php is too long
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.

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['page'];
if ("ipConfig" == $requestPage)
{
$json = '{
"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"
}';
}
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!