PHP code optimization question a. php & lt ;? Php $ title = 'October 13 '; $ classid = '1'; $ a = 'a'; $ B =' B '; $ c = 'C '; $ d = 'd ';? & Gt; B. php & lt ;? Phpif (file_exists ('A. php') php code optimization
A. php
$ Title = 'October 22, March 5 ';
$ Classid = '1 ';
$ A = 'a ';
$ B = 'B ';
$ C = 'C ';
$ D = 'd ';
?>
B. php
If (file_exists ('A. php ')){
Include ('A. php ');
$ Filesname = 'Your file .txt ';
$ Txt = file ($ filesname );
Foreach ($ txt as $ row ){
$ Text = $ text. $ row .'
';}
When footer1_file_get_contents('footer.html ');
How can we optimize PHP code to make browsing faster?
A. is it better to use data in php?
------ Solution --------------------
There is no need to optimize these lines of code.
You cannot feel the effect after optimization.
------ Solution --------------------
In a file, it is optimal not to include nested content.
------ Solution --------------------
The most important thing to optimize this code is the format. the code that does not pay attention to indentation is the most ugly.
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service