/    Sign up×
Community /Pin to ProfileBookmark

Similar string not matched?

Hi

Can someone please explain why it prints 2?

[CODE]
<?php
if (‘&#65279;EMAIL’ == ‘EMAIL’){
print “1”;
}else{
print “2”;
}
?>
[/CODE]

Thanks

to post a comment
PHP

4 Comments(s)

Copy linkTweet thisAlerts:
@NogDogJan 25.2013 — Works fine for me:
<i>
</i>C:WindowsTemp&gt;php -r "if('EMAIL' == 'EMAIL') { print '1';} else {print '2';}"
1
C:WindowsTemp&gt;

Are you sure that's the exact code you are testing?
Copy linkTweet thisAlerts:
@phantom007authorJan 25.2013 — That IS the actual thing, and I posted it here because I could not find any reason why it would not match. I mean both are simple strings. If you copy/paste my above code and try it on ur end, it will not work.

I just wanna know the reason.


Thanks
Copy linkTweet thisAlerts:
@NogDogJan 25.2013 — You have some sort of non-printing character right before the "E" of the first "EMAIL" (between the quote and the "E").
Copy linkTweet thisAlerts:
@phantom007authorJan 26.2013 — Thanks fro your kind help
×

Success!

Help @phantom007 spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.17,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...