I am trying to detect if a certain character is at the begining of a string. basically like this
If(strpos($txtEquip,"+")==0){
$Equip="ADD";
}elseif(strpos($txtEquip,"-")==0){
$Equip="SUBTRACT";
}
If a char is found at the beggining of a string strpos returns 0, BUT apparently it also returns 0 (i.e. false) even if it isn't found at the begging of the string. SO this is making my code always return "ADD" even if the first char is actually a "-" sign.
Am I doing something wrong here or is strpos thing screwy?
Thanks!😃