Câu hỏi phỏng vấn PHP
Câu hỏi

What does the 'var' keyword mean in PHP?

Câu trả lời

The var keyword in PHP is used to declare a variable without specifying its data type. It is a shorthand way of declaring a variable using the $ symbol followed by the variable name.

Here's how you can use the var keyword in PHP:

php Copy
var $variable_name = value;

For example:

php Copy
var $name = "John Doe";
var $age = 30;
var $is_student = true;

In the above example, we have declared three variables using the var keyword:

  • $name is assigned the string value "John Doe"
  • `$...
junior

junior

Gợi ý câu hỏi phỏng vấn

junior

What is the difference between var_dump() and print_r() ?

junior

How is it possible to set an infinite execution time for PHP script?

senior

What's better at freeing memory with PHP: unset() or $var = null ?

Bình luận

Chưa có bình luận nào

Chưa có bình luận nào