bilis_money Posted September 19, 2007 Share Posted September 19, 2007 I know this is basic but, I took an exam on PHP and i dropped it. too bad. I really don't know the meaning of this ? on php? What question mark can do on php? Could you give me an example. Thanks in advance. Quote Link to comment https://forums.phpfreaks.com/topic/69936-what-is-question-mark-in-php/ Share on other sites More sharing options...
EKINdesigns Posted September 19, 2007 Share Posted September 19, 2007 Ha...What are you asking? Quote Link to comment https://forums.phpfreaks.com/topic/69936-what-is-question-mark-in-php/#findComment-351257 Share on other sites More sharing options...
Psycho Posted September 19, 2007 Share Posted September 19, 2007 It depends in what context you are talking about. For example in this case: HTML goes here <?php //php code goes here ?> HTML goes here The ?'s are used to identify the beginning and end of PHP code In this case $var = ($x ==1) ? 'a' : 'b'; It is used as part of a tertiary operator. Quote Link to comment https://forums.phpfreaks.com/topic/69936-what-is-question-mark-in-php/#findComment-351259 Share on other sites More sharing options...
FridayRain Posted September 19, 2007 Share Posted September 19, 2007 What language is native to you? The question mark has several purposes. The most common are probably the beginning and end tags for PHP inside HTML: <?php echo 'Hello world.'; ?> And passing variables through URLs: http://www.domain.com/news.php?article=5876773 And others. Quote Link to comment https://forums.phpfreaks.com/topic/69936-what-is-question-mark-in-php/#findComment-351261 Share on other sites More sharing options...
leonglass Posted September 19, 2007 Share Posted September 19, 2007 It is part of the ternary operator if used in a script. You may also see it in a url in which case it is a separator between the url and variables. Quote Link to comment https://forums.phpfreaks.com/topic/69936-what-is-question-mark-in-php/#findComment-351263 Share on other sites More sharing options...
bilis_money Posted September 19, 2007 Author Share Posted September 19, 2007 HA HA HA You are all also very very funny. You don't understand the ? on php. The exam really that i took is very hard than i expected. I tested this example codes below, <?php ????? $var=10;??? ????? ??? echo "Testing!"; ?? ????? ?> and the outcome it says nothing really happens, meaning the question mark doesn't affect anything on the code. Now i know it is nothing... HA HA HA clever Test. Thanks anyway, but i think if i dare you to take the exam you guys will also drop it. I"m sure. ha ha ha Quote Link to comment https://forums.phpfreaks.com/topic/69936-what-is-question-mark-in-php/#findComment-351276 Share on other sites More sharing options...
BlueSkyIS Posted September 19, 2007 Share Posted September 19, 2007 yes, "nothing" will happen because that won't even compile. Quote Link to comment https://forums.phpfreaks.com/topic/69936-what-is-question-mark-in-php/#findComment-351292 Share on other sites More sharing options...
leonglass Posted September 19, 2007 Share Posted September 19, 2007 Parse error: syntax error, unexpected '?' in /var/www/localhost/htdocs/gamvc/index.php on line 2 is what happens. Quote Link to comment https://forums.phpfreaks.com/topic/69936-what-is-question-mark-in-php/#findComment-351333 Share on other sites More sharing options...
LiamProductions Posted September 19, 2007 Share Posted September 19, 2007 Maybe its some sort of comment like # ;p Quote Link to comment https://forums.phpfreaks.com/topic/69936-what-is-question-mark-in-php/#findComment-351337 Share on other sites More sharing options...
FridayRain Posted September 20, 2007 Share Posted September 20, 2007 Can I administer an English exam? Quote Link to comment https://forums.phpfreaks.com/topic/69936-what-is-question-mark-in-php/#findComment-351554 Share on other sites More sharing options...
BlueSkyIS Posted September 20, 2007 Share Posted September 20, 2007 You are all also very very funny. You don't understand the ? on php. Quote Link to comment https://forums.phpfreaks.com/topic/69936-what-is-question-mark-in-php/#findComment-351562 Share on other sites More sharing options...
Jessica Posted September 20, 2007 Share Posted September 20, 2007 Uhm, where is this exam? Quote Link to comment https://forums.phpfreaks.com/topic/69936-what-is-question-mark-in-php/#findComment-351566 Share on other sites More sharing options...
redarrow Posted September 20, 2007 Share Posted September 20, 2007 please give me this link for the so called hard php exam?. Quote Link to comment https://forums.phpfreaks.com/topic/69936-what-is-question-mark-in-php/#findComment-351573 Share on other sites More sharing options...
FridayRain Posted September 20, 2007 Share Posted September 20, 2007 You are all also very very funny. You don't understand the ? on php. Are you trying to imply that we're the dense ones here? The question mark serves several roles. Your silly example, which would never be part of actual code, arguably doesn't return the result you say it does. If you aren't going to use question marks correctly, especially to prove this stupid, irrelevant, useless point, who cares? Let me conjure up an imaginary English exam so you can explain the purpose of question marks "on English" and, regarding the exam, "drop it." Quote Link to comment https://forums.phpfreaks.com/topic/69936-what-is-question-mark-in-php/#findComment-351597 Share on other sites More sharing options...
thryb Posted September 20, 2007 Share Posted September 20, 2007 ~# ./drama off lol Quote Link to comment https://forums.phpfreaks.com/topic/69936-what-is-question-mark-in-php/#findComment-351611 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.