我想同時運行多個url,但我不想複製並粘貼到數組中。我想把它放在一個字符串中,並用逗號將它分解爲雙引號,就像我們在數組中寫入一樣。如何將字符串分解爲雙引號並用逗號分隔php?
我從這個
$urls = "
http://
http://
http://
http://";
想進入這個
$urls = array("http://","http://","http://","http://");
這是我迄今所做
<?php
$urls = "
http://
http://
http://";
$url = preg_match_all('/"(?:\\\\.|[^\\\\"])*"|\S+/', $urls, $matches);
foreach($url as $ul){
echo $ul[1];
}
?>
由'\ n'爆炸。 '$ arr = explode(「\ n」,$ urls);' – Tushar