0

我有这个结果来自 var_dump

$arr = explode("\n", $str);
var_dump($arr);

array(1) {
  [0]=>
  string(16) "Ìäíå ãÕÑí (EGP) "
}
array(1) {
  [0]=>
  string(72) " 0.5358 1 Ìäíå ãÕÑí = 0.5358 ÑíÇá ÓÚæÏí 1 ÑíÇá ÓÚæÏí = 1.8664 Ìäíå ãÕÑí "
}
array(1) {
  [0]=>
  string(72) " 0.5353 1 Ìäíå ãÕÑí = 0.5353 ÑíÇá ÓÚæÏí 1 ÑíÇá ÓÚæÏí = 1.8682 Ìäíå ãÕÑí "
}
array(1) {
  [0]=>
  string(8) " 0.09 % "
}

我需要在另一个数组中获取每个值

$arr[0]="Ìäíå ÕÑí (EGP)";

$arr[1]=" 0.5358 1 Ìäíå ãÕÑí = 0.5358 ÑíÇá ÓÚæÏí 1 ÑíÇá ÓÚæÏí = 1.8664 Ìäíå ãÕÑí ";

$arr[2]=" 0.5353 1 Ìäíå ãÕÑí = 0.5353 ÑíÇá ÓÚæÏí 1 ÑíÇá ÓÚæÏí = 1.8682 Ìäíå ãÕÑí ";

$arr[3]=" 0.09 % ";

4

1 回答 1

0

只需将 $arr 传递给另一个数组变量

$foo = array();
$foo = $arr;
于 2013-08-01T00:41:19.073 回答