I havent been able to find an answer to this:
My code works like this:
echo ' <p> '.$test2.'</p> ';
I want to make $test2 change if it is null i have tried the following code and bunch of other and it just breaks the page
$test2 = if(empty($price)){ return $pstatus};
Any help would be apprteciated
UPDATE I have modified my code, now it returns the price but if the price is empty its returning nothing when it should return the $pstatus
so $price is say 625000 is that variable is empty it should return sold from the $pstatus variable
$price = number_format($p->meta_box->REAL_HOMES_property_price);
$fimage = $p->better_featured_image->media_details->sizes->medium->source_url;
$ptitle = $p->title->rendered;
$pdesc = $p->excerpt->rendered;
$plink = $p->link;
$pstatus = $p->pure_taxonomies->{"property-status"}[0]->name;
$test2 = $pstatus ? $price : $test2;