sungpeng Posted October 31, 2012 Share Posted October 31, 2012 What is the different between => and >= in php ? Quote Link to comment https://forums.phpfreaks.com/topic/270102-different-between-and/ Share on other sites More sharing options...
Monkuar Posted October 31, 2012 Share Posted October 31, 2012 => is used to extract the key value from an array. example: Foreach ($sungpeng as $phpfreakuser => $id){ } >= Example is $value = 25; if ($value >= 25){ echo 'True!'; }else{ echo 'false... sory'; } Quote Link to comment https://forums.phpfreaks.com/topic/270102-different-between-and/#findComment-1388930 Share on other sites More sharing options...
sungpeng Posted October 31, 2012 Author Share Posted October 31, 2012 I saw something like $value = array(1=>apple; 2=>orange); What does => stand for in this context ? Quote Link to comment https://forums.phpfreaks.com/topic/270102-different-between-and/#findComment-1388934 Share on other sites More sharing options...
HyperTextML Posted October 31, 2012 Share Posted October 31, 2012 In this context, it is setting values in an array. The first value is apple, the second is orange. When reading this script in your head, you can read "=>" as "is set to". Quote Link to comment https://forums.phpfreaks.com/topic/270102-different-between-and/#findComment-1388937 Share on other sites More sharing options...
sungpeng Posted October 31, 2012 Author Share Posted October 31, 2012 $value = array(1=apple; 2=orange); I think is not necessary to add an additional > as = will do the job. Do you think in this way also ? Quote Link to comment https://forums.phpfreaks.com/topic/270102-different-between-and/#findComment-1388942 Share on other sites More sharing options...
Barand Posted October 31, 2012 Share Posted October 31, 2012 $value = array(1=apple; 2=orange); I think is not necessary to add an additional > as = will do the job. Do you think in this way also ? No. 1) I have read the manual - try it sometime 2) I have run that code with error reporting turned on - try that too Quote Link to comment https://forums.phpfreaks.com/topic/270102-different-between-and/#findComment-1388946 Share on other sites More sharing options...
sungpeng Posted October 31, 2012 Author Share Posted October 31, 2012 Thanks.. Quote Link to comment https://forums.phpfreaks.com/topic/270102-different-between-and/#findComment-1388956 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.