Page 1 of 1

Rstricting the Character Display

Posted: Wed Jun 25, 2008 10:47 pm
by arunkar
Hi experts,

Well Im just a beginner in php. I looked at the php functions at w3schools and searched Google for a function that could allow me to show only few characters in the output. But I could get one.

Im pulling out some records from the db. I have a text field that has lots of characters. I need to display only 80 characters, How could I do it?

Is there a function that would enable me to do it :?:

Thanks experts.

Re: Rstricting the Character Display

Posted: Wed Jun 25, 2008 10:50 pm
by WebbieDave
The good old substr function will do the trick.

Re: Rstricting the Character Display

Posted: Wed Jun 25, 2008 11:26 pm
by arunkar
Just the one I was looking for.


Thanks WebbieDave! :D

Re: InStr function - chech for a certain charcter in a string

Posted: Wed Jun 25, 2008 11:32 pm
by arunkar
WebbieDave since you are online can I ask you another string function.

I could'nt find a Instr function. I want to check the inpot string for "http://" if it exists I want to remove it from the string and store it into the db.

do you know what string function that could do it :?:

Thanks a lot

Re: Rstricting the Character Display

Posted: Wed Jun 25, 2008 11:40 pm
by WebbieDave
Take a look at stripos