scottybwoy Posted July 29, 2008 Share Posted July 29, 2008 Does anyone know a website that has comparisons for different languages. For instance I want to know the javascript equivalent for isset($var) in php? Have searched in google, but don't seem to get the right results. Thanks Quote Link to comment https://forums.phpfreaks.com/topic/117131-solved-language-comparison-reference/ Share on other sites More sharing options...
RichardRotterdam Posted July 29, 2008 Share Posted July 29, 2008 actually javascript and php are very similar in syntax so having having a manual on the different functions wouldnt be that much of value. there are some slight differences. i think the isset($var) you can simply replace with if(jsVar!=undefined){} //or if(jsVar!=null){} Quote Link to comment https://forums.phpfreaks.com/topic/117131-solved-language-comparison-reference/#findComment-602735 Share on other sites More sharing options...
corbin Posted July 29, 2008 Share Posted July 29, 2008 I can't point you to a differences list, but as to your example, I've seen checking for set variables two ways: if(someVar) //I see this one from time to time.... Only problem is that I don't know if it's technically //ok to do this. Some how I don't think it is. Also, what if the variable is set, but it's false.... lol //and: if(typeof someVar == 'undefined') //I think this might be the right way. Quote Link to comment https://forums.phpfreaks.com/topic/117131-solved-language-comparison-reference/#findComment-602851 Share on other sites More sharing options...
scottybwoy Posted July 30, 2008 Author Share Posted July 30, 2008 Thanks for your help, it's just annoying, coming from one language to another, and knowing what you want to do, but not knowing the syntax. I went with the undifined version, works like a charm thanks. Quote Link to comment https://forums.phpfreaks.com/topic/117131-solved-language-comparison-reference/#findComment-603388 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.