Second PHP interview

Source: Internet
Author: User
: This article mainly introduces the second PHP interview. if you are interested in the PHP Tutorial, please refer to it. I went to abuse again in the past two days. after the interview, I felt that I was lost. All right, let's just talk about it.

1. differences between session and cookies.
I don't want to talk about it anymore. baidu.
But let's just put it another way. session_id is generally stored in cookies and transmitted to the server through the header. If cookie is disabled, it can only be transmitted through url.

2. write the following program results.


  key = 100; }  functionchangeStr($input){$input = '100'; } $input = 0; changeNum($input); echo$input.'
'; $input2['key'] = 0; changeArray($input2); echo$input2['key'].'
';$input3 = new class1();$input3->key = 0; changeObj($input3); echo$input3->key.'
';$input4 = '123'; changeStr($input4); echo$input4;classclass1{}?>

This article mainly describes how to store and reference data types.

3. how to exchange values of a and B without using the third variable.

$a = 1;$b = 2;list($a,$b)=array($b,$a);echo$a.$b;

Another method is to intercept strings, which is not described here.

4. differences between PDO and mysql.

Well, pdo is better than php-mysql. I don't know where I am.

5. display encoding of the specified page in at least two ways

header('content-type:text/html;charset=utf-8');
  

6. What are the meanings of 200 and 404 returned in the http request header?

200 indicates that the request is successful.
404 indicates that the requested resource does not exist.

For the moment, I can only think of these methods, and I will try again later.

'). AddClass ('pre-numbering '). hide (); $ (this ). addClass ('Has-numbering '). parent (). append ($ numbering); for (I = 1; I <= lines; I ++) {$ numbering. append ($ ('
  • '). Text (I) ;}; $ numbering. fadeIn (1700) ;}) ;}; script

    The above introduces the second PHP interview, including the content, hope to be helpful to friends interested in PHP tutorials.

    Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.