爆炸功能对我不起作用?

时间:2017-06-07 01:53:23

标签: php

我想在使用foreach()之后将字符串更改为数组           怎么做?

$g = "";
$changer = explode(",", $g);
foreach ($y as $key => $c) {
    foreach ($c['movie'] as $rr) {
        $g .= $rr->movieName . ",";
    }
}

2 个答案:

答案 0 :(得分:1)

根据你的回答,这比你正在做的更简单:

foreach ($y as $key => $c) {
    foreach ($c['movie'] as $rr) {
        $changer[] = $rr->movieName;
    }
}

答案 1 :(得分:0)

我自己找到了答案唯一的问题是我的爆炸功能的位置:

server {
      listen 80;

      root /var/www/html/;
      index index.html index.htm;

      server_name example.com;

      location / {

      }
}