各要素にURLを含む文字列を格納する$bigArrayWithLinksという配列があります。var_dumpのサンプルを次に示します。
array
0 => string 'http://en.wikipedia.org/wiki/England' (length=36)
1 => string 'http://www.bbc.co.uk/news/england/' (length=34)
2 => string 'http://www.thefa.com/' (length=21)
3 => string 'http://www.thefa.com/England/' (length=29)
私がやりたいのは、配列を反復処理し、値「0」の整数を各要素に追加して、次のようになるようにすることです。
array
0 => string 'http://en.wikipedia.org/wiki/England' => int '0'
1 => string 'http://www.bbc.co.uk/news/england/' => int '0'
2 => string 'http://www.thefa.com/' => int '0'
3 => string 'http://www.thefa.com/England/' => int '0'
私は試した:
for($x=0; $x<sizeof($arr); $x++)
{
$score = $arr[$x]['score'];
$score = '0';
}
私はphpに非常に慣れていないので、それが機能しなかったことに驚かされませんでした。誰かが私を助けてくれませんか?前もって感謝します!