PDA

View Full Version : PHP Phrase Question


TheMayhem
01-31-2006, 09:37 PM
This is something simple that I've seen used many times but don't know what the function is. Let's say you have a phrase

$hello = "Hello World;

The function I'm looking for is something where if I want it to only display the first 8 characters it'd show

Hello Wo

And so forth, any ideas on what I need to use for this kind of function?

Xenon
01-31-2006, 09:42 PM
substr is your friend:

http://de.php.net/manual/en/function.substr.php

TheMayhem
01-31-2006, 09:51 PM
Indeed it is :) thanks.

Xenon
02-01-2006, 02:09 PM
you're welcome