When concatenate php variable result not showing.
$a = 5;
$b = 4;
$o = '+';
echo $a.$o.$b;
result showing 5+4; but i want show result 9
How can i do this, anybody can help me out.
Thanks in advance.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
‘+’ is a string, so if you concate it with a number you get a string. You have to look into the value:
Or what you probably want: