0
How do I change the type of a variable in a Constant?
PHP
3 Answers
+ 1
Hi, sorry but I can't understand the instruction clearly. I don't know how to help you when I can't understand the instruction.
0
What exactly did you mean "change the type of variables in a constant"?
P.S. Put PHP in the thread tags, avoid writing codes into tags ā
0
1. Create a php script lab-1-3.php, in which create a constant NUM_E with a value of 2.71828 (number e).
2. Display the value of this constant in the form of the string "The number e is ...".
3. Assign a constant value to the $ num_e1 variable and display the name of the $ num_e1 variable, its value and type (ie, the browser should get a string like "$ num_e1 = 2.71828 double").
4. Change the type of the $ num_e1 variable sequentially to string, integer and boolean, each time displaying the type and the resulting value of the $ num_e1 variable.