我有两个字符串变量:PHP如何转换2个独立字符串转换为关联数组(如索引和值)
$names = "Sean Connery,George Lazenby,Roger Moore,Timothy Dalton,Pierce,Brosnan,Daniel Craig";
$movies = "Dr. No/On Her Majesty's Secret Service/Live and Let Die/The Living Daylights/GoldenEye/Casino Royal";
我需要这两个字符串转换为关联数组$names
作为index
和$movies
作为values
。我将如何做到这一点?
您是否尝试过的东西? – Rizier123
你想要完整的$ name作为索引? –
[explode()](http://php.net/explode)想起来 – 2015-04-12 20:52:46