


Technical problems encountered in entrepreneurship in 2015: 121-130
121.What is the difference between . and -> in PHP?
$this->, use "->" to call the class method.
".", what does it mean? (Of course, it can represent string connection.)
122.Thinkphp determines whether you are logged in.
As we gradually learn PHP in depth, many problems will not be clear until we gain more experience.
First, I logged in and jumped to the article, but it never succeeded.
$this->error("Username or password is incorrect","article");
Can I only use redirect?
123. Thinkphp’s redirect function is garbled in Chinese.
header("Content-type:text/html;charset=utf-8");
Find the redirect function in ThinkPHP/Common/functions.php.
The redirect method in ThinkPHP/Lib/Core/Action.class.php seems to be better.
A function and a method are added with a header statement to specify the encoding.
Reference: http://www.thinkphp.cn/topic/11472.html
124. Yunda has a courier, but the record cannot be found online.
The courier guy said that they can only check it internally.
This happens to some orders, why?
125. Thinkphp’s include tag.
include has many uses, some are "full paths, which need to be suffixed", and some are "relative paths, which do not need suffixes".
For more information, please refer to: http://www.cnblogs.com/bafeiyu/archive/2013/02/20/2918136.html
126. PHP formats dates and obtains array elements.
{$item.ctime}, the date can be displayed normally in Thinkphp: "2015:3:12 11:11:11".
However, I found that in native PHP, the display is not normal.
Later I discovered that when getting elements in PHP, don’t use “.” anymore, just use the standard item["ctime"].
Is there a concept of EL expression in PHP?
127. Found a new Juqery plug-in, jquery.pngfix.js.
Let all browsers support png.
Don’t all browsers support png? I’ve heard that the png format is a “standard” a long time ago.
128. Thinkphp has a weird problem in getting variables.
<script></script>
var cid = "{$article['cid']}";
var prid = "{$article['prid']}";
console.log("cid2:" +cid);
console.log("prid2:"+prid);
if(cid){
$("#cid").val(cid);
}
if(prid ){
$("#prid").val(prid);
}
There is a piece of code "A". Before A, there is the latest value. After A, The data was never right.
What is hair?
Found the reason, redefined the variable below and covered it.
How to locate the problem: the old routine, "binary search".
129. There are too many CSS codes and it’s too confusing.
It has caused interference, the effect of some styles has been abnormal, and the positioning problem is really troublesome.
130.AJAX executes asynchronously and can use callbacks.
The paging statement fupage, after execution, renders the data.
Then, the "bidding progress" can be processed.
//Rewrite the over method
FuPage.prototype.over=function(a,b,c){
progressbar();
}
Use the "callback" method to complete.
fuPage = new FuPage();
After paging is completed, the over method will be called.
Wuhan Jiutianniao - p2p online loan system development - Internet application software development
Company official website: http://jiutianniao.com
Social Q&A: http://ask.jiutianniao.com
The above introduces the technical problems encountered in entrepreneurship in 2015: 121-130, including aspects of content. I hope it will be helpful to friends who are interested in PHP tutorials.

ThesecrettokeepingaPHP-poweredwebsiterunningsmoothlyunderheavyloadinvolvesseveralkeystrategies:1)ImplementopcodecachingwithOPcachetoreducescriptexecutiontime,2)UsedatabasequerycachingwithRedistolessendatabaseload,3)LeverageCDNslikeCloudflareforservin

You should care about DependencyInjection(DI) because it makes your code clearer and easier to maintain. 1) DI makes it more modular by decoupling classes, 2) improves the convenience of testing and code flexibility, 3) Use DI containers to manage complex dependencies, but pay attention to performance impact and circular dependencies, 4) The best practice is to rely on abstract interfaces to achieve loose coupling.

Yes,optimizingaPHPapplicationispossibleandessential.1)ImplementcachingusingAPCutoreducedatabaseload.2)Optimizedatabaseswithindexing,efficientqueries,andconnectionpooling.3)Enhancecodewithbuilt-infunctions,avoidingglobalvariables,andusingopcodecaching

ThekeystrategiestosignificantlyboostPHPapplicationperformanceare:1)UseopcodecachinglikeOPcachetoreduceexecutiontime,2)Optimizedatabaseinteractionswithpreparedstatementsandproperindexing,3)ConfigurewebserverslikeNginxwithPHP-FPMforbetterperformance,4)

APHPDependencyInjectionContainerisatoolthatmanagesclassdependencies,enhancingcodemodularity,testability,andmaintainability.Itactsasacentralhubforcreatingandinjectingdependencies,thusreducingtightcouplingandeasingunittesting.

Select DependencyInjection (DI) for large applications, ServiceLocator is suitable for small projects or prototypes. 1) DI improves the testability and modularity of the code through constructor injection. 2) ServiceLocator obtains services through center registration, which is convenient but may lead to an increase in code coupling.

PHPapplicationscanbeoptimizedforspeedandefficiencyby:1)enablingopcacheinphp.ini,2)usingpreparedstatementswithPDOfordatabasequeries,3)replacingloopswitharray_filterandarray_mapfordataprocessing,4)configuringNginxasareverseproxy,5)implementingcachingwi

PHPemailvalidationinvolvesthreesteps:1)Formatvalidationusingregularexpressionstochecktheemailformat;2)DNSvalidationtoensurethedomainhasavalidMXrecord;3)SMTPvalidation,themostthoroughmethod,whichchecksifthemailboxexistsbyconnectingtotheSMTPserver.Impl


Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

Safe Exam Browser
Safe Exam Browser is a secure browser environment for taking online exams securely. This software turns any computer into a secure workstation. It controls access to any utility and prevents students from using unauthorized resources.

VSCode Windows 64-bit Download
A free and powerful IDE editor launched by Microsoft

MantisBT
Mantis is an easy-to-deploy web-based defect tracking tool designed to aid in product defect tracking. It requires PHP, MySQL and a web server. Check out our demo and hosting services.

SAP NetWeaver Server Adapter for Eclipse
Integrate Eclipse with SAP NetWeaver application server.

SecLists
SecLists is the ultimate security tester's companion. It is a collection of various types of lists that are frequently used during security assessments, all in one place. SecLists helps make security testing more efficient and productive by conveniently providing all the lists a security tester might need. List types include usernames, passwords, URLs, fuzzing payloads, sensitive data patterns, web shells, and more. The tester can simply pull this repository onto a new test machine and he will have access to every type of list he needs.
