I want to display result after searching an array but only title coming as result, but I want to display more values.
1) If I using following code then entire data coming in long string like
Array
(
[] => SONY CDX-G1150U - CD, USB, FM/AM Tuner with MP3/WMA Playback (Single DIN)59902 Pre-Out (Rear + Sub Switchable) Digital Clarity Tuner Subwoofer Easy Connection EQ3 stage 2 / Bollywood EQ mode / Illumination - Red 55W x 4 Output Power (Dynamic Reality Amp 2) Steering Remote Input Ready Mega Bass 2 Year Sony India Warranty http://www.snapdeal.com/product/sony-cdxg1150u-cd-usb-fmam/914627741http://n1.sdlcdn.com/imgs/a/o/m/SONY-CDX-G1150U-CD-USB-SDL133242160-1-51ec4.jpg311Car Audio & Video310Automotive4017in stock
)
$r = $array3['title'];
$r .= $array3['mrp'];
$r .= $array3['description'];
$r .= $array3['link'];
$r .= $array3['image_link'];
$r .= $array3['sub_category_id'];
$r .= $array3['sub_category_name'];
$r .= $array3['category_id'];
$r .= $array3['category_name'];
$r .= $array3['offer_price'];
$r .= $array3['availability'];
$matches = array();
$pattern = "/\bSony\b/";
if(preg_match($pattern,$r) || preg_match($pattern,$ss) ){
$matches[$key]=$r;
echo "<pre>";print_r($matches);
2) If I using following code (with or condition) then also same result displaying.
$r = $array3['title'];
$ss = $array3['mrp'];
$matches = array();
$pattern = "/\bSony\b/";
if(preg_match($pattern,$r) || preg_match($pattern,$ss) ){
$matches[$key]=$r;
echo "<pre>";print_r($matches);