2016-11-28 166 views
-4

我有單,雙引號括號在PHP如何在括號中使用php中的單引號和雙引號?

使用我有錯誤,如果附近的狀況,請任意一個幫助

$resonjob['Post_type']='Jobs'; 
    $resonjob['reason']='reasonstatus.php?job_id='.$row['job_id']; 
    $nestedData[] = '<select onchange="reasonstatus(this.value)" style="width:80px;"> 
    <option value="'.$resonjob['reason'].'&type='.$resonjob['Post_type'].'&status=1" '.if($row['status']=='1'){.' selected;'.}.'>Active</option> 
    <option value="'.$resonjob['reason'].'&type='.$resonjob['Post_type'].'&status=2" '.if($row['status']=='2'){.' selected;'.}.' >Inactive</option> 
    </select>'; 
+0

什麼是烏拉圭回合的問題 – Ima

+0

有你的錯誤問題? – scaisEdge

+0

我有錯誤附近,如果條件 –

回答

0
<?php 
$resonjob['Post_type']='Jobs'; 
    $resonjob['reason']='reasonstatus.php?job_id='.$row['job_id']; 
    $nestedData[] = '<select onchange="reasonstatus(this.value)" style="width:80px;"> 
    <option value="'.$resonjob['reason'].'&type='.$resonjob['Post_type'].'&status=1" '.($row['status']=='1' ? 'selected' : '').'>Active</option> 
    <option value="'.$resonjob['reason'].'&type='.$resonjob['Post_type'].'&status=2" '.($row['status']=='2' ? ' selected' : '').' >Inactive</option> 
    </select>'; 
+0

謝謝jiri Hrazdil它工作得很好謝謝你這麼多..... –