Home > Backend Development > PHP Tutorial > Brief description of PHP entry-level interview questions (3)

Brief description of PHP entry-level interview questions (3)

韦小宝
Release: 2023-03-17 15:34:01
Original
2850 people have browsed it

PHP Junior Interview Questions are for programmers with little experience who are just looking for a job. This provides a lot of help for us to go out for interview, InterviewOfficial meetings often test us, and the interview questions played a big role at this time

20. In PHP, heredoc is a A special string, its end mark must be the same as the beginning, and there must be a line break before the end mark, followed by a semicolon

  • 20. Write the SQL of the names of the ten people with the most posts, using the following table: members(id,username,posts,pass,email)

select username from members order by posts DESC limit 10
Copy after login

21. Please explain the difference between passing by value and passing by reference in PHP. When to pass by value and when to pass by reference?

Pass by value: Any changes to the value within the scope of the function will be ignored outside the function

    Pass by reference: Any changes to the value within the scope of the function will also reflect these modifications outside the function
  • Advantages and Disadvantages: When passing by value , php must copy the value. Especially for large strings and objects, this can be an expensive operation.
  • Passing by reference does not require copying the value, which is very good for improving performance.
  • 22. What is the function of error_reporting in PHP?

Used to configure the level of error message reporting

23. Please write a function verification email Is the format correct

function validateEmail($email)
{
    if(eregi('^[_a-z0-9-]+(.[_a-z0-9-]+)*@[a-z0-9-]+(.[a-z0-9-]+)*$',$email) ){
    return true;
    }else{
    return false;
    }
}
Copy after login

24. Briefly describe how to get the current execution script path, including the obtained parameters.

echo $_SERVER['scrīpt_FILENAME']."?".$_SERVER['QUERY_STRING'];
Copy after login

26. What is the function of the JS form pop-up dialog box? The function of getting input focus is?

alert(),prompt(),confirm() //弹出对话框
Copy after login
focus() //输入焦点
Copy after login
27. What is the redirection function of JS? How to introduce an external JS file?

window.location.href  //转向跳转函数
Copy after login
<scrīpt src=""/> //引入外部js文件
Copy after login

28. How to declare a class named "myclass" without methods and attributes?

class myclass{
    ...
};
Copy after login

29. How do you access and set the properties of a class?

$newmyclass = new myclass();
$temp=$newmyclass->testvalue;
$newmyclass->testvalue="a";
Copy after login
30. What is the difference between mysql_fetch_row() and mysql_fetch_array?

mysql_fetch_row  //从结果集中取得一行作为枚举数组
mysql_fetch_array  //从结果集中取得一行作为关联数组,或数字数组,或二者兼有
Copy after login

Don’t worry after reading the above interview questions. There are other interview questions. It is best to consolidate the basic things to help us interview and find jobs.

Related recommendations:

php Junior Interview Questions Brief Description Questions (1)

Brief description of PHP junior interview questions (2)

5 common questions among PHP junior developers

The above is the detailed content of Brief description of PHP entry-level interview questions (3). For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template