Created code like above.Code:<?php $brand = 'Sony Xperia J'; $product = 'Mobile'; $android = 'Jelly Bean 4.3'; $shop = 'Flipkart'; echo ' Purchased ' . $brand . $product . ' from ' . $shop . ' . Android version is ' . $android;
Result below
Purchased Sony Xperia JMobile from Flipkart . Android version is Jelly Bean 4.3
there is no gap between xperia j and Mobile.
So i just added the . ' ' . to get space.
echo ' Purchased ' . $brand . ' ' . $product . ' from ' . $shop . ' . Android version is ' . $android;
2 doubts
1. Is there any issue if two variables come together ? ($brand . ' ' . $product .)
2. any problem if we use quote ,when we have text and numeric values ($android = 'Jelly Bean 4.3';). I just tried by removing the quote. but showing error message.




Reply With Quote
Bookmarks