0
空の値として '1970-01-01'を返す日付フィールドがあります。だから私は、変数$from
.Stillのための三項演算子を作成したい、それは私が間違って変数の3進演算子
$from=$asset_other_details->start_date; //1970-01-01
$from == '1970-01-01' ? '' : $from ;
空の値として '1970-01-01'を返す日付フィールドがあります。だから私は、変数$from
.Stillのための三項演算子を作成したい、それは私が間違って変数の3進演算子
$from=$asset_other_details->start_date; //1970-01-01
$from == '1970-01-01' ? '' : $from ;
をした1970-01-01.What返しますあなたは以下のような比較出力に基づいて$form
に新しい値を代入する必要があります -
$from = $asset_other_details->start_date; //1970-01-01
$from = ($from == '1970-01-01') ? '' : $from ;
理解するための出力: - https://eval.in/867743
新しい価値$from
を割り当てていません。次のことを試してみてください。
$from = ($asset_other_details->start_date == '1970-01-01') ? '' : $asset_other_details->start_date;
私はあなたがfrom' – user3386779
を与えられた正確なテキストを確認してください。 – msfoster
が割り当てでそれを行う '再割り当てしていない – chris85