面试题与答案
了解热门 PHP 面试题与答案,帮助应届生和有经验的候选人为求职面试做好准备。
面试前建议观看的最佳 LIVE 模拟面试
了解热门 PHP 面试题与答案,帮助应届生和有经验的候选人为求职面试做好准备。
面试题与答案
搜索问题以查看答案。
应届生 / 初级级别面试题与答案
Would I use print "$a dollars" or "{$a} dollars" to print out the amount of dollars in this example?
保存以便复习
保存以便复习
收藏此条目、标记为困难题,或将其加入复习集合。
How do you define a constant?
保存以便复习
保存以便复习
收藏此条目、标记为困难题,或将其加入复习集合。
How do you pass a variable by value?
保存以便复习
保存以便复习
收藏此条目、标记为困难题,或将其加入复习集合。
When are you supposed to use endif to end the conditional statement?
保存以便复习
保存以便复习
收藏此条目、标记为困难题,或将其加入复习集合。
Explain the ternary conditional operator in PHP?
E.g $id = isset($_GET['id']) ? $_GET['id'] : false;
保存以便复习
保存以便复习
收藏此条目、标记为困难题,或将其加入复习集合。
How do you call a constructor for a parent class?
保存以便复习
保存以便复习
收藏此条目、标记为困难题,或将其加入复习集合。
Why doesn't the following code print the newline properly?
$str = 'Hello, there.nHow are you?
print $str;
?>
Because inside the single quotes the n character is not interpreted as newline, just as a sequence of two characters - and n.
保存以便复习
保存以便复习
收藏此条目、标记为困难题,或将其加入复习集合。
Would you initialize your strings with single quotes or double quotes?
保存以便复习
保存以便复习
收藏此条目、标记为困难题,或将其加入复习集合。
What is the difference between characters 23 and x23?
保存以便复习
保存以便复习
收藏此条目、标记为困难题,或将其加入复习集合。
I want to combine two variables together:
$var1 = 'Welcome to '; $var2 = 'TechInterviews.com';What will work faster? Code sample 1: -
$var 3 = $var1.$var2;Or code sample 2:
$var3 = "$var1$var2";Both examples would provide the same result - $var3 equal to "Welcome to TechInterviews.com". However, Code Sample 1 will work significantly faster. Try it out with large sets of data (or via concatenating small sets a million times or so), and you will see that concatenation works significantly faster than variable substitution.
保存以便复习
保存以便复习
收藏此条目、标记为困难题,或将其加入复习集合。
<?php echo 'Welcome ', 'to', ' ', 'TechInterviews!'; ?>and it will output the string "Welcome to TechInterviews!" print does not take multiple parameters. It is also generally argued that echo is faster, but usually the speed advantage is negligible, and might not be there for future versions of PHP. printf is a function, not a construct, and allows such advantages as formatted output, but it's the slowest way to print out data out of echo, print and printf.
保存以便复习
保存以便复习
收藏此条目、标记为困难题,或将其加入复习集合。
中级 / 1 到 5 年经验级别面试题与答案
What's the difference between include and require? -
保存以便复习
保存以便复习
收藏此条目、标记为困难题,或将其加入复习集合。
Will comparison of string "10" and integer 11 work in PHP?
保存以便复习
保存以便复习
收藏此条目、标记为困难题,或将其加入复习集合。
Are objects passed by value or by reference?
保存以便复习
保存以便复习
收藏此条目、标记为困难题,或将其加入复习集合。
What's the special meaning of __sleep and __wakeup?
保存以便复习
保存以便复习
收藏此条目、标记为困难题,或将其加入复习集合。
What's the difference between htmlentities() and htmlspecialchars()?
保存以便复习
保存以便复习
收藏此条目、标记为困难题,或将其加入复习集合。
How do you match the character ^ at the beginning of the string?
保存以便复习
保存以便复习
收藏此条目、标记为困难题,或将其加入复习集合。
资深 / 专家级别面试题与答案
I am trying to assign a variable the value of 0123, but it keeps coming up with a different number, what's the problem?
保存以便复习
保存以便复习
收藏此条目、标记为困难题,或将其加入复习集合。
How do I find out the number of parameters passed into function?
保存以便复习
保存以便复习
收藏此条目、标记为困难题,或将其加入复习集合。
If the variable $a is equal to 5 and variable $b is equal to character a, what's the value of $$b?
保存以便复习
保存以便复习
收藏此条目、标记为困难题,或将其加入复习集合。
What's the difference between accessing a class method via -> and via ::?
保存以便复习
保存以便复习
收藏此条目、标记为困难题,或将其加入复习集合。
How come the code <?php print "Contents: $arr[1]"; ?> works, but <?php print "Contents: $arr[1][2]"; ?> doesn't for two-dimensional array of mine? -
保存以便复习
保存以便复习
收藏此条目、标记为困难题,或将其加入复习集合。
With a heredoc syntax, do I get variable substitution inside the heredoc contents?
保存以便复习
保存以便复习
收藏此条目、标记为困难题,或将其加入复习集合。
I am writing an application in PHP that outputs a printable version of driving directions. It contains some long sentences, and I am a neat freak, and would like to make sure that no line exceeds 50 characters. How do I accomplish that with PHP?
保存以便复习
保存以便复习
收藏此条目、标记为困难题,或将其加入复习集合。
What's the difference between md5(), crc32() and sha1() crypto on PHP?
保存以便复习
保存以便复习
收藏此条目、标记为困难题,或将其加入复习集合。
So if md5() generates the most secure hash, why would you ever use the less secure crc32() and sha1()?
保存以便复习
保存以便复习
收藏此条目、标记为困难题,或将其加入复习集合。
用户评价最有帮助的内容:
- What does a special set of tags <?= and ?> do in PHP?
- What's the difference between include and require? -
- I am trying to assign a variable the value of 0123, but it keeps coming up with a different number, what's the problem?
- How do you define a constant?
- Would I use print "$a dollars" or "{$a} dollars" to print out the amount of dollars in this example?