fsk141 Posted August 2, 2007 Share Posted August 2, 2007 Hello, I'm new to php, and are having trouble with a few characters, and understanding what they are there for. I'm reading a book and upon reading I see these characters and would like to know what they are there for: .= => (in arrays) !$_POST (what is the ! mark for>) If anyone could help me to understand what these are thanks in advance... Quote Link to comment https://forums.phpfreaks.com/topic/62973-solved-need-to-clear-some-things-up/ Share on other sites More sharing options...
teng84 Posted August 2, 2007 Share Posted August 2, 2007 ill give example rather that explaining this $x ='yes'; $x .='no'; now $x= yesno but if $x ='yes'; $x ='yes'; now $x= no $x=array('a'=>1); //=> its like saying index a is equal to 1 so it like $x['a'] = 1; ! means not so when !$_POST it means if not post or empty Quote Link to comment https://forums.phpfreaks.com/topic/62973-solved-need-to-clear-some-things-up/#findComment-313600 Share on other sites More sharing options...
trq Posted August 2, 2007 Share Posted August 2, 2007 .= is a quick way of appending to a variable. So... <?php $s = 'string'; $s .= 'more'; echo $s; // echos 'stringmore' // short for $s = 'this'; $s = $s.'more'; ?> => is used when creating associative arrays. Assciative arrays let you reference array values by a key instead of a numeric index. So... <?php $a = array('foo' => 'bar'); echo $a['foo']; // echos 'foo' ?> The ! operator checks for false. So.... <?php $b = true; if (!$b) { echo '$b == false'; } else { echo '$b == true'; } ?> Hope that helps. More details can be found here... the manual will be your life long friend. Quote Link to comment https://forums.phpfreaks.com/topic/62973-solved-need-to-clear-some-things-up/#findComment-313602 Share on other sites More sharing options...
fsk141 Posted August 2, 2007 Author Share Posted August 2, 2007 Hey, Thats exactly what I needed, thank you very much. and I know != means doesn't equal, yet it didn't know it applied to other functions. Thanks... Quote Link to comment https://forums.phpfreaks.com/topic/62973-solved-need-to-clear-some-things-up/#findComment-313603 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.