2014-01-23 50 views
0

我接收到該錯誤 「警告:非法串偏移‘寬度’在接觸me.php上線250在WordPress糾非法串偏移警告插件

警告:非法串在接觸偏移‘標題’在線252「-me.php」

我意識到這段代碼在文件中是錯誤的,但我不熟悉PHP,但我想知道如果有人可以幫我重寫本節消除錯誤。謝謝! (錯誤從第250行開始,以$ width開始,第252行以$ title開頭)。

我試着在其他線程上實現一些更正,但是不成功。感謝您的協助。

function shortcode_handler($_atts) { 
    if ($this->check_settings() === true) { 
     $width = intval($_atts["width"]); 
     if ($width < 100 || $width > 1000) $width = ""; 
     $title = $_atts["title"]; 
     if (empty($title)) $title = htmlspecialchars($this->options['form_title'], ENT_QUOTES); 
     $suffix = "_".rand(1000, 9999); 
     $form = ' 

我解決了它。 我用下面的代碼:

if (isset($_atts["width"])) 
     $width = var_dump($_atts["width"]);   
    if (isset($_atts["title"])) 
     $title = var_dump($_atts["title"]); 
+0

你應該自己添加一個答案,並接受它:) – snollygolly

+0

感謝您的建議慢。我發佈了一個答案,但根據我的閱讀,我必須等待48小時才能接受它。 – user3229432

回答

0

我用下面的代碼:

if (isset($_atts["width"])) 
    $width = var_dump($_atts["width"]);   
if (isset($_atts["title"])) 
    $title = var_dump($_atts["title"]); 
相關問題