1) I notice i cant do something like this in PHP,
echo "Length is " . $some_var + 4;
I have to add brackets like,
echo "Length is " . ($some_var + 4);
I suppose that is regular syntax maybe some languages you wouldn't need brakets there??
2) As for casting there can't really be any in PHP as there are no variables types?
For example if i have
$char_var = "5";
$add_var = $char_var +7;
I haven't even tried this i should have first, but anyway,
like in other langaues you would have to cast the char "5" into say an int, like
$add_var = int($char_var) +7;
What are the basic rules?
echo "Length is " . $some_var + 4;
I have to add brackets like,
echo "Length is " . ($some_var + 4);
I suppose that is regular syntax maybe some languages you wouldn't need brakets there??
2) As for casting there can't really be any in PHP as there are no variables types?
For example if i have
$char_var = "5";
$add_var = $char_var +7;
I haven't even tried this i should have first, but anyway,
like in other langaues you would have to cast the char "5" into say an int, like
$add_var = int($char_var) +7;
What are the basic rules?