PHP Interview Second bomb

Source: Internet
Author: User
These two days went to find abuse, after the interview feeling born can not love, hehe. Well, don't say much, just go straight to the question.

1, talk about the difference between the session and the cookie.
Don't want to say, self-Baidu bar.
But let's just say that session_id is usually stored in cookies and passed through header headers to the server, and if a cookie is disabled, it can only be passed through the URL.

2, write the results of the following procedure.


     functionchangenum($input){$input= -; } functionchangearray($input){$input[' key '] = -; } functionchangeobj($input){$input->key = -; } functionchangestr($input){$input=' + '; }$input=0; Changenum ($input);Echo$input.'
'
;$input 2[' key '] =0; Changearray ($input 2);Echo$input 2[' key '].'
'
;$input 3=NewClass1 ();$input 3->key =0; Changeobj ($input 3);Echo$input 3->key.'
'
;$input 4=' 123 '; CHANGESTR ($input 4);Echo$input 4; classClass1{}?>

The main research here is the storage of data types and the problem of reference methods.

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

$a1;$b2;list($a,$b)=array($b,$a);echo$a.$b;

Another way to do this is through the interception of strings, which is not introduced here.

The difference between 4,pdo and MySQL.

Well, PDO is better than Php-mysql. Don't ask me where the hell is, I don't know.

5, in at least two ways to implement the display encoding of the specified page

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

What does the 6,http request header return 200 and 404 represent?

200, indicating that the request was successful.
404, indicating that the request resource does not exist.

Temporarily can only think of these words, and later remembered to add.

'). addclass (' pre-numbering '). Hide (); $ (this). addclass (' has-numbering '). Parent (). append ($numbering); for (i = 1; i <= lines; i++) {$numbering. Append ($ ('
  • '). Text (i)); }; $numbering. FadeIn (1700); }); });

    The above describes the PHP interview second play, including the aspects of the content, I hope that the PHP tutorial interested in a friend helpful.

  • 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.