split after number of characters?

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
zerodegreeburn
Forum Newbie
Posts: 24
Joined: Thu Jul 04, 2002 6:42 am
Contact:

split after number of characters?

Post by zerodegreeburn »

e.g.

$name = "something defined in url";

if its longer than 16 characters, then i want to split it up into

$name = first 16 characters
$name2 = second 16 characters

etc etc etc

how do i do this?
User avatar
twigletmac
Her Royal Site Adminness
Posts: 5371
Joined: Tue Apr 23, 2002 2:21 am
Location: Essex, UK

Post by twigletmac »

Have a look at substr():
http://www.php.net/substr

Mac
zerodegreeburn
Forum Newbie
Posts: 24
Joined: Thu Jul 04, 2002 6:42 am
Contact:

Post by zerodegreeburn »

thanks a lot :)
Post Reply