Share EncyclopediaHome EncyclopediaCategories Switch Channel

Programmer interview required php basic interview – 12th day

2026-02-04 07:02640NameNetworking

I. Date with $day1, $day2 in yyyy-mm-dd format

Make time stamp with mktime() and date() in yyyy-mm-dd format

Please write the roles of php-l, php-m, php-r。

Php –l: syntax: test php

Php –r: run php code directly

Php –m: internal and loaded php and zend modules will be printed

Iii. Write out the templates that you know well that can get HTML and php out of here, and outline the principles of their work

Smarty

The tpl template document is prepared in the php officially developed smarty template language. The tpl file will be automatically compiled when it is first called by the hbcms system and will generate a php file stored in the template/system/compile directory. Later on, the tpl file is called again, and the smarty system will automatically judge whether the tpl file has been modified and, if not, will not repeat it, but will read the last php file compiled。

Iv. How to get a proceedings between n-m

$start =microtime;

Program snippet

$end=microtime(true);

Echo ($end-$start);

V. How to achieve string flipping?

1. Self-hat functionstrev()

2

$str = "abcdefg";

Php time stamp pattern

Funaction strevv($str){

$len=strlen ($str);

$newstr=♪ i'm sorry ♪';

For ($i=$len; $i>=0; $i--) {

$newstr. = $str;

I'm sorry;

$showstr = strevv ($str);

I'm sorry, i'm sorry, but i'm sorry

" ;

Vi. Description of the meaning of line file $server

Remote addr

$server

“php self”

Php time stamp pattern

Line : lines of the current file

File : full path and filename of the returned file. If used in the contained file, return the contained file first name

$server

Remote addr

: browsed the ip address of the current page user。

$server

“php self”

: script files currently being implemented first name

How can access to the database be improved? On what basis

1. Table design must be optimized, with minimal redundancy of data and less use of connection queries. The design of the data sheets would have to be reconsidered if, in practical applications, extremely complex connections, sub-surveys, were used。

2. Use char rather than varchar as much as possible, because a fixed length of string is used faster. ... In today's growing volume of hard drives, it is worthwhile to sacrifice space for storage and to increase the speed of queries。

3. Increasing the speed of inquiries by simplifying privileges. If a query is preceded by a lot of permission authentication, the speed of the query will slow down and try to log in on mesql with root login and the speed of login with your new authorized user, as you can see, root log in and enter immediately, while the average user will always be delayed。

4. Table optimization. If a table has been in place for some time, the data will become fragmented as the update and deletion operations occur, which will likewise increase the time spent on physical searches in the table. You know, in mysql's bottom design, the database will be mapped to a directory with some sort of file structure, while the table will be mapped to a file. So disk fragments are likely to happen. Fortunately, in mysql, we can fix it by saying:

If you have sufficient access to the database (dbname=test db), please open access to the database to all access rights for the testuser on the 192. 168. 1. 100 server。

Php time stamp pattern

* to testuser@192. 168. 1. 100 agreed by "123";

Ix. Under what circumstances would a backup database be required? How to back up the database

Preservation of data integrity to prevent data loss, virus infection

1. Direct copy of database files

2. Use mysqldump

3. Backup using tools

X. Assuming that the mysql server is now slow, how can specific query statements that cause slowness be found? How can it be terminated

Check every sql statement with microtime

Analyse the effects of a self statement with an explain statement, e. G., explain can get a self statement

Index information used, sorting, etc。

The termination of the execution of the statement will enable the process to be detected and the process to be performed to be killed。

Show processlist;

Kill found id;

Like 0
Report
Favorite 0
Tip 0
Comment 0
Share 4
MoreRelated Comments
No comments yet, be the first to comment
Activate the electromagnetic valve of the gas heater
As society evolves, most urban households use gas heaters. It is easy and fast to provide hot water at all times, and even in the winter it can be comfortable to bathe at home, wash its faces, wash its vegetables, cook, etc. And we all know that the electromagnetic valve is one of the most important components of the gas heater. The electromagnetic valves of the gas heater are mainly used to control the combustion of the gas heater. So what's the

0评论2026-08-13170

What's an infectious endometriosis
First page -cardiovascular disease -infective endocrinitis -what is the infective endocardia? RinWhat's an infectious endometriosisInfective endometriitis (infective endocarditis) is defined as the inflammation of the heart valve or inner membrane caused by direct infections of bacteria, fungi and other micro-organisms (e. G. Viruses, ricksels, chlamydia, spirals, etc.), as distinct from non-infective endometriitis due to rheumatism, rheumatism,

0评论2026-08-13145