私はそれらを交換するには、2つの配列、文字との1を交換するための、文字と1持って次のようなクエリの結果を通じて動作していない文字列を置き換える
$charToReplace = array("é", "è", "ê");
$charReplacements = array("e", "e", "e");
Iループを、そしてとき私はartist_nameフィールドに到達し、文字が配列内にあれば置換したい。私はこのようにそれを実行しようと、それは私のエラーを取得:
$itemrow['artist_name'] = str_replace($charToReplace, $charReplacements, $itemrow['artist_name']);
これは私が受け取るエラーです:
このページは以下のエラーが含まれています列で29行に
エラーを9:エンコーディングエラー 以下は、最初のエラーまでのページのレンダリングです。
<?xml version="1.0" encoding="UTF-8"?>
<artists>
<artist>
<id>855</id>
<name>Have Heart</name>
<picture>http://userserve-ak.last.fm/serve/126/29086375.jpg</picture>
<twitter></twitter>
</artist>
<artist>
<id>856</id>
<name>Carpathian</name>
<picture>http://userserve-ak.last.fm/serve/126/50284337.jpg</picture>
<twitter></twitter>
</artist>
<artist>
<id>857</id>
<name>Deftones</name>
<picture>http://userserve-ak.last.fm/serve/126/2203330.jpg</picture>
<twitter></twitter>
</artist>
<artist>
<id>858</id>
<name>Converge</name>
<picture>http://userserve-ak.last.fm/serve/126/29640629.jpg</picture>
<twitter></twitter>
</artist>
<artist>
<id>859</id>
<name>Touchrtist>
<id>878</id>
<name>True Colors</name>
<picture>http://userserve-ak.last.fm/serve/126/46942947.jpg</picture>
<twitter></twitter>
</artist>
最初のものは正しいですが、最後の休憩:
この
は、PHPで生成されたXMLコードです。それはTouchéと言うべきですが、何とかそれは壊れてしばらくしてから続きます。
あなたのコードはPHPで、あなたの質問にはActionScriptタグが付いていますか? – Marty
これはもうありません;) – weltraumpirat
@weltraumpirat Haha、私はそれを変更しようとしていましたが、予期せぬ理由でAS3にタグ付けされているかどうかはわかりませんでした:P – Marty