我從很多年以來一直在編程php。現在我有了一個新的願望。我想和一個長字符串更可讀的數組:PhP:將數組分解成多行
$var = array('help' => 'This is a very long help text. This is a very long help text. This is a very long help text.');
首先嚐試:我已經試過這沒有成功:
$var = array('help' => 'This is a very long help text.'
. 'This is a very long help text.'
. 'This is a very long help text.');
第二個嘗試:我已經試過這沒有成功:
$var = array('help' => 'This is a very long help text.' . 'This is a very long help text. This is a very long help text.');
順便說一句:有沒有機會建立字符串之前,我必須在這一行。如何將數組分成更多行?
我被要求展示真實的例子,那就是:
class JKWerte {
public static $purifyoptions = array(
'HTML.Allowed' => 'table, thead, tbody, tfoot, th, tr, td, img[src|alt], div, span, p, br, ul, ol, li, *[class], *[style], *[height], *[width], h1, h2, h3, h4, a[href|title], b, i, em, strong');
public function test() {
}
}
變量是一個類的屬性,我和 JKWerte :: purifyoptions調用它;
*我怎樣才能打破陣列爲更多的行*您指的是在代碼分成多行或多個元素? – Rizier123 2015-04-04 14:57:20
「在代碼中」但我也對多個元素感興趣「。 – Didgejo 2015-04-04 14:59:27
只需再次查看您的代碼,兩次嘗試都應該正常工作!你有任何錯誤?添加錯誤報告:'<?php \t \t ini_set(「display_errors」,1); \t \t error_reporting(E_ALL); \t?>' – Rizier123 2015-04-04 15:06:07