0
An issue with the exclamation mark
<?php $a = 'hello'; $hello = "Hi"; $Hi = "hola"; echo $$a; ?> // output is hola <?php $a = 'hello'; $hello = "Hi!"; $Hi! = "hola"; echo $$a; ?> //output is ERROR! what is wrong with the exclamation mark (!) ?
4 Antworten
+ 2
It outputs an error because an exclamation mark is a special character and cannot be used in a variable name.
0
mmm can we add the word Hi! inside parentheses? >> $(Hi!)="hola"
0
Including an exclamation mark in a variable name is not a legal declaration.
- 2
?