


1. There is the following HTML:
1) Use js to obtain the ________ method to obtain the object;
2) Use the ________ attribute to get the attribute value of the attribute title;
3) Use the ________ method to get the attribute value of the attribute sina_title;
(1) document.getElementById('img1');
(2) document.getElementById('img1').getAttribute('title');
(3) document.getElementById('img1').getAttribute('sina_title');
2. Pair array in php The serialization and deserialization functions are ______ and _______ respectively;
serialize, upserialize
3. The difference between rawurlencode and urlencode functions is ____________________;
rawurlencode will convert spaces to +, urlencode will convert spaces into %20
4. The function to filter HTML in php is _______, and the escaping function is ____________;
strip_tags,htmlspecialchars
5. Write out the js in HTML using regular expressions Scripts are filtered out;
preg_replace('/
6. The meaning of LEFT JOIN in SQL is ______________;
if There is a table tl_user that stores student ID and name, and another table tl_score that stores student ID, subject and score (some students do not have test scores). Write a sql statement to print out the student's name and total score of each subject;
A left join first takes out all the data from the left table, and then takes out the data from the right table that satisfies the where condition. When the data in this row does not meet the where condition, it returns empty.
select tu.name,sum(ts.score) as totalscore from tl.user left join tl_score on tl.uid = ts.uid;
7. Write three functions that call system commands;
system, passthru, exec
8. Josn’s function for processing arrays is;
json_encode, json_decode
9. Determine whether a variable is set in PHP The function is_______; the one that determines whether it is empty is___________;
isset, empty
10. The difference between error_reporting("E_ALL") and ini_set("display_errors", "on")_________;
The former is to set the error display level, and E_ALL means to prompt all errors (including notice, warning and error). The latter is to set php to display errors. In the error display control, the latter has the highest priority.
11. PHP writes the predefined variable _________ that displays the client IP; the source URL is provided by __________;
$_SERVER['REMOTE_ADDR'],$_SERVER['HTTP_REFERER']
12 , The function that PHP uses to convert UTF-8 to gbk is___________;
iconv('UTF-8','GBK',$str);
13. The function that splits a string into an array in PHP__________ , what connects numbers to form a string is _______;
explode,implode
14. How to use static methods of classes in PHP_______________________________;
Outside the class, use: class name followed by double colon, and then Following is the method name, similar to classname::staticFucntion(). Since the static method does not belong to an object, but to the entire class, it must be called with the class name.
2.
1. What is the reason for the following error: mysql server not go away? (This is probably like this)
It should be mysql has gone away, right?
Usually it is caused by the value set by max_allowed_packet is too small. max_allowed_packet is used to control the packet size of the buffer, sometimes when importing data , if this value is too small, it will easily cause insufficient buffer capacity. The problem can be solved by setting this value in my.ini or my.cnf to a larger value.
Another possibility is that the singleton mode is used when connecting to the database. The database is operated multiple times but the same connection is used. Since mysql processes each thread in queue mode, the current operation has not been completed and the interval is less than This problem is prone to occur when the value set by wait_timeout is high. The solution is to set the value of wait_timeout larger.
2. The difference between static tables and dynamic tables in mysql, and the difference between MyISAM and InnoDB.
Static tables are static when a table does not use variable length fields such as varchar, blob, and text. On the other hand, if a table contains at least one variable-length field, or if a table is created with the ROW_FORMAT=DYNAMIC option, the table is a dynamic table.
The difference between myisam and innodb is that myisam does not support transaction processing, because it does not need to do commit operations, so the operation speed will be faster than innodb. innodb is better than myisam in terms of security because it supports transaction processing, insert, update, delete, and select. When the operation defaults to autocommit=0, each operation will be treated as a transaction and can be rolled back.If autocommit=1, it will automatically commit the transaction after each operation, which will cause the execution efficiency to be very slow, probably 10 times slower than myisam.
3, $a = 1; $b = & $a;
unset($a), is $b still 1, why?
unset($b), is $a still 1? Why?
are all equal to 1.
In PHP, reference assignment is different from pointer. It just points another variable name to a certain memory address. In this question: $b = &$a; just points the name $b to the memory address pointed to by the $a variable. When unset, only the pointer to this name is released, but the value in the memory is not released. On the other hand, unset($a) does not actually release the value in the memory immediately. It only releases the pointer of this name. This function will only release the value when the space occupied by the variable value exceeds 256 bytes. The memory is released, and the address will be released only when all variables pointing to the value (such as reference variables pointing to the value) have been destroyed.
3.
1. Write at least three functions, take the suffix of the file name, such as the file '/as/image/bc.jpg', and get jpg or .jpg.
function myGetExtName1( $path ){
//Get the last occurrence. The index position of this character
$begin = strrpos($path,'.');
//Get the entire string Length
$end = strlen($path);
//The result of intercepting the total length of the string from the index of the last . returns
return $begin?substr($path,$ begin,$end):'The file has no extension';
}
function myGetExtName2($path){
return preg_match_all('/.[^.]+/is',$path,$ m)?$m[0][count($m[0])-1]:'The file has no extension';
}
function myGetExtName3( $path ){
//Find the last The index position of an occurrence of . character and all characters following it are returned together
return strrchr($path,'.')?strrchr($path,'.'):'The file has no extension';
}
2. Write a function to calculate the relative paths of two files, such as $a = '/a/b/c/d/e.php'; $b = '/a/b/12/34/ c.php'; Calculate the phase path of $b relative to $a.
$a = '/a/b/c/d/e.php';
$b = '/a/b/12/34/c.php';
//Ask for $b Relative path relative to $a
function getRelativelyPath($a,$b){
//Split into an array
$a = explode('/',$a);
$b = explode('/',$b);
$path = '';
//Reset the indexes of the two arrays
$c = array_values(array_diff($a,$b)) ;
$d = array_values(array_diff($b,$a));
//Remove the file name of a path
array_pop($c);
//Replace a Replace the directory name in the path with ..
foreach($c as c,$d);
//Splicing path
foreach($e as &$v)
$path .= $v.'/';
return rtrim($path,'/ ');
}
3. Use the binary method (also called the halving search method) to find an element. The object can be an ordered array.
//Binary method to find whether a certain value exists in an array
function binSearchWithArray($array,$searchValue){
global $time;
if(count($array)>=1) {
$mid = intval(count($array)/2);
echo 'th',$time++,'time
';
echo 'Current array: ';print_r($array);echo '
';
echo 'Find location index:',$mid,'
';
echo 'value :',$array[$mid],'
';
if($searchValue == $array[$mid]){
$time--;
return $searchValue.' was found, at the '.$time.'th time, the index is '.$mid.'
';
}
elseif($searchValue < ; $array[$mid]){
$array = array_slice($array,0,$mid);
return binSearchWithArray($array,$searchValue);
}
else{
$array = array_slice($array,$mid+1,count($array));
return binSearchWithArray($array,$searchValue);
}
}
return $searchValue.' Not Found ,50,60,199,35);
//The value to be found
$searchValue = 13;
//Sort the array, the key to dichotomy
sort($array);
echo 'The value to be found is:',$searchValue,'
';
echo binSearchWithArray($array,$searchValue);
These questions say It’s not difficult to be honest, but I still have to admit that I looked up the information for some questions, because there are many functions that I can’t even remember how to write without the help of an IDE. Even if I knew and understood some concepts before, I will gradually forget them if I haven’t touched them for a long time, such as Pass that by reference.
During the interview, you are asked to write with a pen. I believe that few people can write all these things with a pen in a short time, especially those who write code later. They need to revise repeatedly because you are thinking in the process. There will definitely be some loopholes in the logic. You need to execute the code to understand what went wrong. Writing it down with a pen is really nonsense. Even if I wrote it on a computer, it still took me 2 or 3 hours to write some of the following codes.
The written test questions during the interview are really open to question. I believe I am not the only one who feels this way, right? The last time I went to Tencent for an interview, I was stumped by the written test questions. When I got there, my mind was blank. After I returned home, I slowly recalled the questions and found that they could all be written.
Everyone, take a look at my answers and see if there are any omissions or errors. I don’t think it’s worth taking these tests, I just think it’s inappropriate to use them as written test questions during interviews. I hope that all of you who have participated in interviews with others in various companies can refer to my opinions and change to a more reasonable assessment method.
Original address: http://bbs.csdn.net/topics/340149214
The above introduces the interview questions said to be from Sina Leju, my answers, and some suggestions for the written test questions, including the content. I hope it will be helpful to friends who are interested in PHP tutorials.

“你的组织要求你更改PIN消息”将显示在登录屏幕上。当在使用基于组织的帐户设置的电脑上达到PIN过期限制时,就会发生这种情况,在该电脑上,他们可以控制个人设备。但是,如果您使用个人帐户设置了Windows,则理想情况下不应显示错误消息。虽然情况并非总是如此。大多数遇到错误的用户使用个人帐户报告。为什么我的组织要求我在Windows11上更改我的PIN?可能是您的帐户与组织相关联,您的主要方法应该是验证这一点。联系域管理员会有所帮助!此外,配置错误的本地策略设置或不正确的注册表项也可能导致错误。即

Windows11将清新优雅的设计带到了最前沿;现代界面允许您个性化和更改最精细的细节,例如窗口边框。在本指南中,我们将讨论分步说明,以帮助您在Windows操作系统中创建反映您的风格的环境。如何更改窗口边框设置?按+打开“设置”应用。WindowsI转到个性化,然后单击颜色设置。颜色更改窗口边框设置窗口11“宽度=”643“高度=”500“>找到在标题栏和窗口边框上显示强调色选项,然后切换它旁边的开关。若要在“开始”菜单和任务栏上显示主题色,请打开“在开始”菜单和任务栏上显示主题

默认情况下,Windows11上的标题栏颜色取决于您选择的深色/浅色主题。但是,您可以将其更改为所需的任何颜色。在本指南中,我们将讨论三种方法的分步说明,以更改它并个性化您的桌面体验,使其具有视觉吸引力。是否可以更改活动和非活动窗口的标题栏颜色?是的,您可以使用“设置”应用更改活动窗口的标题栏颜色,也可以使用注册表编辑器更改非活动窗口的标题栏颜色。若要了解这些步骤,请转到下一部分。如何在Windows11中更改标题栏的颜色?1.使用“设置”应用按+打开设置窗口。WindowsI前往“个性化”,然

您是否在Windows安装程序页面上看到“出现问题”以及“OOBELANGUAGE”语句?Windows的安装有时会因此类错误而停止。OOBE表示开箱即用的体验。正如错误提示所表示的那样,这是与OOBE语言选择相关的问题。没有什么可担心的,你可以通过OOBE屏幕本身的漂亮注册表编辑来解决这个问题。快速修复–1.单击OOBE应用底部的“重试”按钮。这将继续进行该过程,而不会再打嗝。2.使用电源按钮强制关闭系统。系统重新启动后,OOBE应继续。3.断开系统与互联网的连接。在脱机模式下完成OOBE的所

任务栏缩略图可能很有趣,但它们也可能分散注意力或烦人。考虑到您将鼠标悬停在该区域的频率,您可能无意中关闭了重要窗口几次。另一个缺点是它使用更多的系统资源,因此,如果您一直在寻找一种提高资源效率的方法,我们将向您展示如何禁用它。不过,如果您的硬件规格可以处理它并且您喜欢预览版,则可以启用它。如何在Windows11中启用任务栏缩略图预览?1.使用“设置”应用点击键并单击设置。Windows单击系统,然后选择关于。点击高级系统设置。导航到“高级”选项卡,然后选择“性能”下的“设置”。在“视觉效果”选

在Windows11上的显示缩放方面,我们都有不同的偏好。有些人喜欢大图标,有些人喜欢小图标。但是,我们都同意拥有正确的缩放比例很重要。字体缩放不良或图像过度缩放可能是工作时真正的生产力杀手,因此您需要知道如何对其进行自定义以充分利用系统功能。自定义缩放的优点:对于难以阅读屏幕上的文本的人来说,这是一个有用的功能。它可以帮助您一次在屏幕上查看更多内容。您可以创建仅适用于某些监视器和应用程序的自定义扩展配置文件。可以帮助提高低端硬件的性能。它使您可以更好地控制屏幕上的内容。如何在Windows11

屏幕亮度是使用现代计算设备不可或缺的一部分,尤其是当您长时间注视屏幕时。它可以帮助您减轻眼睛疲劳,提高易读性,并轻松有效地查看内容。但是,根据您的设置,有时很难管理亮度,尤其是在具有新UI更改的Windows11上。如果您在调整亮度时遇到问题,以下是在Windows11上管理亮度的所有方法。如何在Windows11上更改亮度[10种方式解释]单显示器用户可以使用以下方法在Windows11上调整亮度。这包括使用单个显示器的台式机系统以及笔记本电脑。让我们开始吧。方法1:使用操作中心操作中心是访问

在iOS17中,Apple为其移动操作系统引入了几项新的隐私和安全功能,其中之一是能够要求对Safari中的隐私浏览选项卡进行二次身份验证。以下是它的工作原理以及如何将其关闭。在运行iOS17或iPadOS17的iPhone或iPad上,如果您在Safari浏览器中打开了任何“无痕浏览”标签页,然后退出会话或App,Apple的浏览器现在需要面容ID/触控ID认证或密码才能再次访问它们。换句话说,如果有人在解锁您的iPhone或iPad时拿到了它,他们仍然无法在不知道您的密码的情况下查看您的隐私


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

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

Dreamweaver CS6
Visual web development tools

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.

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.

mPDF
mPDF is a PHP library that can generate PDF files from UTF-8 encoded HTML. The original author, Ian Back, wrote mPDF to output PDF files "on the fly" from his website and handle different languages. It is slower than original scripts like HTML2FPDF and produces larger files when using Unicode fonts, but supports CSS styles etc. and has a lot of enhancements. Supports almost all languages, including RTL (Arabic and Hebrew) and CJK (Chinese, Japanese and Korean). Supports nested block-level elements (such as P, DIV),

ZendStudio 13.5.1 Mac
Powerful PHP integrated development environment
