473,327 Members | 1,930 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,327 software developers and data experts.

substr problem

hi,
i'm dealing with kind of getting a desired number of letters from a text to be printed out and i'm using php's substr to cut them out. if the text in in form of normal character, it's ok, however, as there are special characters (anyone knows about Vietnamese) which cannot, uh, normally be 'substring-ed'

some special chars like â, ®, ©... require more than 1 bytes.. anybody knows how to handle them?

thx alot :D
Dec 24 '08 #1
1 2658
pbmods
5,821 Expert 4TB
Heya, tuananh87vn.

Check out mb_substr() (PHP: mb_substr - Manual).
Dec 29 '08 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: RootShell | last post by:
Dear All Im having some dificulty here: I found a great PHP code by Catalin Mihaila that reads a SRC (Sinclair Spectrum $SCREEN Image Format) and tranforms it into PNG format to show onscreen...
5
by: MuffinMan | last post by:
Hi, I'm trying to add up an integer with the result from substr() like $second_int = substr( .... ) + $int; I know the result from substr() is an integer and so is $int but in the end...
2
by: EvilPlatypus | last post by:
Hi, just new to the list, but couldn't find anything about this on google so I hope it's never been asked before. I'm trying to write a function that takes a rather large (ASCII) string and...
1
by: Patrick Londema | last post by:
Hi, I'm trying to write a function that takes a string and splits this into 3 distinct sections for a project I'm working on. This string in question has the following formet: "% ...
2
by: Ari | last post by:
we have a strange problem with oracle dynamic sql method 4. when selecting a substr we expect to, and normally, receive from oracle in the describe select list (SELDSC) the length of the...
7
by: entropy123 | last post by:
My problem is with the following test code: #include<string>; std::string TestBuff; TestBuff.append("A + B <==> C + D"); std::cout << "TestBuff.length():" << TestBuff.length() << endl;...
2
by: lawpoop | last post by:
Hey folks - I'm working on a spellchecking routine. The pspell libraries don't handle punctuation; I have to make a script a little smarter. I'm having a problem popping English posessive...
1
by: David Resnick | last post by:
Is the assignment of a substr of the string 'a' to 'a' in the code below OK? #include <string> #include <iostream> int main(void) { std::string a = "hello"; std::cout << a << std::endl;
12
by: tfelb | last post by:
Hi all! I bought the book "Programming in C" by Stephen G Kochan. I miss 2 answers at his website. (removestr and the substr function) How can I implement these functions? It would be wonderful...
1
by: Chad | last post by:
I am having a problem with substr() working when I enter the third perimeter. I am working on a price monitoring project that will download data from Amazon.com. After is downloads the page, it...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.