Home >> PHP >> Differentiate between variables and constants in PHP

Differentiate between variables and constants in PHP

There are few differences between variables and constants-

Variables

1)-The value of a variable can be changed during the execution.

2)-Variables require compulsory usage of the $ sign at the start.

Constants

1)-The constant value can’t be changed during script execution.

2)-No dollar sign ($) is required before using a constant.

Post Your Comment

Next Questions
How to increase maximum execution time
How to Increase File Upload Size
Set maximum execution time
Set maximum execution time unlimited
What are the rules for naming a variable
How can you compare objects
Some of the popular frameworks
How to concatenate two strings
How to encrypt password

Copyright ©2022 coderraj.com. All Rights Reserved.