![]() |
![]() |
![]() |
||||
Welcome to the GoFuckYourself.com - Adult Webmaster Forum forums. You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today! If you have any problems with the registration process or your account login, please contact us. |
![]() ![]() |
|
Discuss what's fucking going on, and which programs are best and worst. One-time "program" announcements from "established" webmasters are allowed. |
|
Thread Tools |
![]() |
#1 |
Confirmed User
Join Date: Feb 2007
Location: Sweden
Posts: 5,633
|
PHP Question: How to replace "�"?
Anyone know how I can replace this symbol: � within a string? A regular replace doesn't seem to work.
__________________
Free 🅑🅘🅣🅒🅞🅘🅝🅢 Every Hour (Yes, really. Free ₿itCoins.) (Signup with ONLY your Email and Password. You can also refer people and get even more.) |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#2 |
♥ ♦ ♣ ♠
Industry Role:
Join Date: Sep 2002
Location: Porn Valley, CA
Posts: 10,590
|
delete it and put something else there?
![]()
__________________
![]() ![]() ![]() "I'm selflessly supporting the common good, but only coincidentally looking out for No.1." |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#3 |
Confirmed User
Join Date: Feb 2002
Location: ICQ: 251425 Fr/Au/Ca
Posts: 6,863
|
Industrial strength:
Code:
<? $str = 'Your string here'; $chr = ord('�'); foreach(str_split($str) as $v) $fS .= ((ord($v) != $chr)?$v:''); //Result is in $fS var_dump($fS); ?> |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#4 |
Confirmed User
Industry Role:
Join Date: Mar 2004
Location: Rock Hill, SC
Posts: 5,370
|
You can also do it on the fly. This is what I had to do... but in my script everything runs through index.php...
Code:
$body = ob_get_contents(); $body = utf8_strip_non_ascii($body); $body = str_replace('Ã', '', $body); $body = str_replace(' Â', '', $body); $body = str_replace('Â', '', $body); ob_end_clean(); print $body; |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#5 |
Confirmed User
Industry Role:
Join Date: Mar 2004
Location: Rock Hill, SC
Posts: 5,370
|
Here is an article on it
http://htmlpurifier.org/docs/enduser-utf8.html |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#6 |
Confirmed User
Join Date: Feb 2002
Location: ICQ: 251425 Fr/Au/Ca
Posts: 6,863
|
UTF/Charset manipulation is a right bastard.
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#7 |
Confirmed User
Join Date: Feb 2007
Location: Sweden
Posts: 5,633
|
thanks for all replies!
__________________
Free 🅑🅘🅣🅒🅞🅘🅝🅢 Every Hour (Yes, really. Free ₿itCoins.) (Signup with ONLY your Email and Password. You can also refer people and get even more.) |
![]() |
![]() ![]() ![]() ![]() ![]() |