Rstricting the Character Display

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
arunkar
Forum Commoner
Posts: 50
Joined: Mon Feb 25, 2008 10:37 pm

Rstricting the Character Display

Post 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.
WebbieDave
Forum Contributor
Posts: 213
Joined: Sun Jul 15, 2007 7:07 am

Re: Rstricting the Character Display

Post by WebbieDave »

The good old substr function will do the trick.
arunkar
Forum Commoner
Posts: 50
Joined: Mon Feb 25, 2008 10:37 pm

Re: Rstricting the Character Display

Post by arunkar »

Just the one I was looking for.


Thanks WebbieDave! :D
arunkar
Forum Commoner
Posts: 50
Joined: Mon Feb 25, 2008 10:37 pm

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

Post 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
WebbieDave
Forum Contributor
Posts: 213
Joined: Sun Jul 15, 2007 7:07 am

Re: Rstricting the Character Display

Post by WebbieDave »

Take a look at stripos
Post Reply