Menu
Hi,
I would like to get into the habit of using the ?: operator more often but alas,
I can’t seem to ever make it work and revert to a more familiar habit of IF
So, what is the wrong with the code here?
[code=php]function refile(x){
(x.charAt(0)==’C’) ? x=’file:///’+x.replace(/\/g, “/”); return x : return x;
// if(x.charAt(0)==’C’){ x=’file:///’+x.replace(/\/g, “/”); return x}
// else{return x}
}