Go Back   CodingForums.com > :: Server side development > PHP

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 07-13-2005, 03:32 AM   PM User | #1
rayzun
New Coder

 
Join Date: Feb 2005
Posts: 44
Thanks: 0
Thanked 0 Times in 0 Posts
rayzun is an unknown quantity at this point
utf8 characters

Using 'file_get_contents' to bring in a list of Japanese characters
from a text file I drop them into a array

$array[0] // 大-表

Next array's which contain "-" are split into two var's
It is working BUT
only when I hardcode utf-8 characters

example:

$utf8 = "$array[0]"; // dont work

$utf8 = "大-表"; // works

if(($n = strpos($, '-')) !== false) {
$var1 = substr($utf8, 0, $n-1);
$var2 = substr($utf8, $n);
$var1 = str_replace ("-", "", $var1);
$var2 = str_replace ("-", "", $var2);
echo("$var1."<br>");
echo("$var2."<br>"); }
//output



Im able to work with the utf-8 array's in other scripts using str_replace
however this function I guess is in another format

any ideas why this is ???
rayzun is offline   Reply With Quote
Old 07-13-2005, 09:50 AM   PM User | #2
Fou-Lu
God Emperor


 
Fou-Lu's Avatar
 
Join Date: Sep 2002
Location: Saskatoon, Saskatchewan
Posts: 15,653
Thanks: 4
Thanked 2,451 Times in 2,420 Posts
Fou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to all
This is an interesting question, one I've never thought up before.
Perhaps you can give a post containing this text file, or at least a couple of characters? My system is incapable of creating the characters needed (at least, easily).
Fou-Lu is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 05:33 AM.


Advertisement
Log in to turn off these ads.