I've always wondered what the ? is
Finally after years of php programming I now understand the use of the ? in a line of php code to define variables. It is called a tenerary operator and work like this.
QUESTION : ANSWER ? NO ANSWER
For example, in th examples, let's talk about the $normal variable that I set which will echo selected="selected" in the select menu if the user chose Normal mode in the form.
PHP Example: $normal = (($_GET['mode'] == 'normal') ? ' selected="selected"' : '' );
So in basic terms if the condition ($_GET['mode'] == 'normal') reutrns a TRUE result the variable $normal will be given the result of selected, otherwise a FALSE answer will assign $normal '' for no string.
I found this at phpfreaks while going through their excellent tutorial on building a weighted php/mysql search engine.
Sometimes its hard to be a Kiwi
Being only one of a handful of Kiwi's within our group of friends has its advantages and disadvantages.
Advantage: I'm not North American.
Disadvantage: Our country is full of sheep shaggers.
Advantage: I come from one of the most beautiful countries in the world.
Disadvantage: Our country is full of sheep shaggers.
I'm sure you can see where the list is going. However it never ceases to amaze me that with all the idiocy in the world (Fark) for some reason it's the "Kiwi's" are idiots, stupid, strange, or sheep shaggers news reports that seem to come my way the most, generally care of a Mr Yackley, Mr Erickson, or a Mr Zaczek.
For example here are exerts from the latest forward:
Cross-dressing Miss Alice guilty of contempt
A New Zealand lawyer who took to wearing an Alice in Wonderland costume in court to highlight an alleged cover-up by the army has been found guilty of contempt.
.....
Moodie, 68, found himself named by a columnist for The Times newspaper in London as winner of the world "award for bizarre conduct by a lawyer" in 2006.
He had officially changed his name to Miss Alice and began donning women's clothes in court as part of a protest against what he said was the "old boys'
network" running New Zealand's judiciary.The protest spilled over when he began fighting the contempt charge, and Moodie used the same methods to draw attention to his case and the plight of his clients, Keith and Margaret Berryman.
Moodie today said his cross-dressing days were over as he no longer needed to appear "in a 19th-Century Alice in Wonderland environment that allows pomp, self-importance and deference to the court to eclipse the truth".
He also announced that he was quitting as a practising lawyer, but vowed to continue fighting for justice for the Berrymans.
My point is. We may be a weird bunch from New Zealand, dressing up in funny costumes, finding better ways to extract semen from a bull, or have one of the most boring cities in the world..... but don't knock a sheep until you've tried one!