運行PHP 7.1.5,我有一個很長的字符串輸出,我與preg_match_all分組。我試圖讓每個輸出組成爲一個新的數組key => value。例如,我有一個很長的字符串是這樣的: $string = (
Name: John Doe
Address: 123 Main St
City: Chicago
State: IL
Zip: 60021
Name: Jane Smith
A
我被困在這個問題上,希望有人能幫助我。 我有一個包含如下的配置文件: config system interface
edit "internal1"
set vdom "root"
set ip 192.168.1.1 255.255.255.0
set allowaccess ping https ssh http fgfm capwap
set ty
這是我的原字符串: - $data = "<br />
Q.156) Direction (156–160): Study the given pie-charts carefully to answer the questions that follow: <br />
Breaking up :- Number of Employees working in Different Depar
我嘗試了很多組合來創建正確的正則表達式,但我失敗了。 我想讀此,輸入: [@Homer Jay Simpson](id:homer) is a good guy.
,並得到 Array (
[0] => "[@Homer Jay Simpson](id:homer)",
[1] => "Homer Jay Simpson",
[2] => "homer"
)