gevo12321 Posted December 12, 2008 Share Posted December 12, 2008 I always get confused when to use = and when to use == if i have tow variables $x and $y and they are both text variables what do i need to use? Link to comment https://forums.phpfreaks.com/topic/136734-solved-or/ Share on other sites More sharing options...
rhodesa Posted December 12, 2008 Share Posted December 12, 2008 in PHP, = is an assignment operator, == is a comparison. $x = $y; //Sets $x equal to the value of $y if($x == $y){ print '$x and $y are equal'; } Link to comment https://forums.phpfreaks.com/topic/136734-solved-or/#findComment-714079 Share on other sites More sharing options...
Maq Posted December 12, 2008 Share Posted December 12, 2008 if i have tow variables $x and $y and they are both text variables what do i need to use? Use for what? You want to assign $x to $y or do you want check if they're equal? Look at rhodesa's post. Link to comment https://forums.phpfreaks.com/topic/136734-solved-or/#findComment-714084 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.