Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
特定のWebページからコンテンツを取得し、次のマーク:'を別のサブストリングに置き換えようとしています。これは通常のアポストロフィではなく、substr_count($content,"’")0を返します。そのマークを検出できないようです。そのため、substr_replaceを使用して彼を置き換えることはできません。
substr_count($content,"’")
この問題をどのように処理できますか?
前もって感謝します。
ユニコード文字を扱っている場合。マルチバイト文字列関数を使用するのが賢明です
http://www.php.net/manual/en/function.mb-substr-count.php