我如何可以显示或根据结果隐藏DIV除法来自服务器,用于处理请求的文件中,我得到一个客户对象从数据库中,根据用户的要求,如果我没有找到我想隐藏div的相应客户。秀取决于结果从服务器
这里是我的PHP代码
$customer=getCustomerViaCellPhone($link,$cellPhoneNo);
if(!$customer){
$error = 'No result found';
}
这里的景色
<div id="customerInfo" class="<?php (is_null($customer))?'hide':''?>">
....
</div>
但它表明在两种情况下的div
检查你的功能getCustomerViaCellPhone在手机的情况下返回不存在/未找到 – Sleeperson
干了什么'的var_dump($客户)'返回? – ajreal
NULL [ “customerCellPhone:私人”] => NULL [ “customerTelephone:私人”] => NULL [ “customerDob:私人”] => NULL [ “customerCountry:私人”] => NULL [ “customerCity:私人”] = > NULL [ “customerNeighborhood:私人”] => NULL [ “customerStreet:私人”] => NULL [ “customerAddressDetails:私人”] => NULL [ “customerEmail:私人”] => NULL – palAlaa