This is confusing me, can someone explain this to me. | Sololearn: Learn to code for FREE!
Novo curso! Todo programador deveria aprender IA generativa!
Experimente uma aula grƔtis
0

This is confusing me, can someone explain this to me.

<?php $a = 'hello'; $hello = "Hi!"; echo $a; // Outputs 'Hi!' ?> I donā€™t understand how this works. What does ā€˜echo $a;ā€™ do. How would I use it. Helllpppp!

20th Nov 2018, 4:53 PM
Mail Exe
Mail Exe - avatar
4 Respostas
+ 1
Think reverse $a = 'hello' => 'hello'=>$a $hello=$a $s='Hi!' Hope you understand one thing to note: use search bar
20th Nov 2018, 4:56 PM
Roneel
Roneel - avatar
+ 1
First you have double sign for variable => $. $a = 'hello', so we have $($a => 'hello'), next is $hello (first evaluating inner variable $a which is the string 'hello'), then the outer $hello (which is the string 'Hi!'). Hope it helps you :)
20th Nov 2018, 5:41 PM
TheWhĀ”teCat šŸ‡§šŸ‡¬
TheWhĀ”teCat šŸ‡§šŸ‡¬ - avatar
0
i dont really understand =/
20th Nov 2018, 4:59 PM
Mail Exe
Mail Exe - avatar
0
Nope, i still dont understand this :((((((((
20th Nov 2018, 5:42 PM
Mail Exe
Mail Exe - avatar