Click here to Skip to main content
15,915,093 members
Home / Discussions / Linux, Apache, MySQL, PHP
   

Linux, Apache, MySQL, PHP

 
GeneralRe: Help with this expression Pin
cjoki7-Jun-10 2:20
cjoki7-Jun-10 2:20 
GeneralRe: Help with this expression Pin
cjoki7-Jun-10 5:25
cjoki7-Jun-10 5:25 
GeneralRe: Help with this expression Pin
xx77abs11-Jun-10 6:32
xx77abs11-Jun-10 6:32 
AnswerRe: Help with this expression PinPopular
User 17164924-Jun-10 6:33
professionalUser 17164924-Jun-10 6:33 
GeneralRe: Help with this expression Pin
cjoki6-Jun-10 9:45
cjoki6-Jun-10 9:45 
GeneralRe: Help with this expression Pin
xx77abs6-Jun-10 10:08
xx77abs6-Jun-10 10:08 
GeneralRe: Help with this expression Pin
whatrevolution22-Jun-10 23:52
whatrevolution22-Jun-10 23:52 
AnswerRe: Help with this expression Pin
whatrevolution23-Jun-10 0:13
whatrevolution23-Jun-10 0:13 
This happens because strings, not just "a", are type cast to integer type when compared against an integer, and the integer that they are equivalent to is zero, which equals zero. Smile | :)

<?php<br />
<br />
$typecastme = array(<br />
  'a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z'<br />
);<br />
<br />
echo '<pre>';<br />
foreach ($typecastme as $int => $str) {<br />
  echo 'if('.$str.'=='.$int.') is: '.($str==$int?'TRUE':'FALSE')."\n";<br />
  echo ''.$str.' as boolean is: '.((bool)$str?'TRUE':'FALSE')."\n";<br />
  echo ''.$str.' as integer is: '.(integer)$str."\n";<br />
  echo 'var_dump('.$str.'=='.$int.') is: ';<br />
  var_dump($str==$int);<br />
  echo 'var_dump((int)'.$str.'==0) is: ';<br />
  var_dump((int)$str==0);<br />
  echo "\n";<br />
}<br />
echo '</pre>';


QuestionCloning a XLS worksheet in PHP Pin
Bijayani31-May-10 23:47
Bijayani31-May-10 23:47 
AnswerRe: Cloning a XLS worksheet in PHP Pin
Kristian Sixhøj3-Jun-10 7:29
Kristian Sixhøj3-Jun-10 7:29 
AnswerRe: Cloning a XLS worksheet in PHP Pin
Richard MacCutchan3-Jun-10 8:40
mveRichard MacCutchan3-Jun-10 8:40 
QuestionLearning Linux Pin
pc.bharti27-May-10 23:33
pc.bharti27-May-10 23:33 
AnswerRe: Learning Linux Pin
Richard MacCutchan28-May-10 0:10
mveRichard MacCutchan28-May-10 0:10 
GeneralRe: Learning Linux Pin
wbgxx21-Jun-10 3:58
wbgxx21-Jun-10 3:58 
AnswerRe: Learning Linux Pin
Iranian MM7-Sep-11 6:51
Iranian MM7-Sep-11 6:51 
QuestionPHP DOM Pin
vho12320-May-10 4:50
vho12320-May-10 4:50 
AnswerRe: PHP DOM Pin
Graham Breach20-May-10 7:06
Graham Breach20-May-10 7:06 
QuestionManaging a database insert failure.. Pin
MacIntyre19-May-10 4:57
MacIntyre19-May-10 4:57 
AnswerRe: Managing a database insert failure.. [modified] Pin
Dr.Walt Fair, PE19-May-10 5:26
professionalDr.Walt Fair, PE19-May-10 5:26 
GeneralRe: Managing a database insert failure.. Pin
MacIntyre19-May-10 5:39
MacIntyre19-May-10 5:39 
GeneralRe: Managing a database insert failure.. Pin
Dr.Walt Fair, PE19-May-10 6:02
professionalDr.Walt Fair, PE19-May-10 6:02 
GeneralRe: Managing a database insert failure.. Pin
MacIntyre19-May-10 6:32
MacIntyre19-May-10 6:32 
GeneralRe: Managing a database insert failure.. Pin
Dr.Walt Fair, PE19-May-10 6:53
professionalDr.Walt Fair, PE19-May-10 6:53 
GeneralRe: Managing a database insert failure.. Pin
MacIntyre19-May-10 7:53
MacIntyre19-May-10 7:53 
GeneralRe: Managing a database insert failure.. Pin
User 171649219-May-10 7:14
professionalUser 171649219-May-10 7:14 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.