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

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

韦小宝
韦小宝Original
2017-11-16 16:07:432773browse

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

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;
    }
}

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

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

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

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

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

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

class myclass{
    ...
};

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

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

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

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!

Statement:
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
Previous article:Is PHP easy to learn?Next article:Is PHP easy to learn?