Splitting a string

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This numer has dynamic lenght, witch is the root of my problems.

$number = 123456789

should print as following:
var1: 12345   (and it is this lengt witch varies)
var2: 67   
var3: 89.

I've been using substr with negative numbers to fetch the last two vars.
thereafter explode to get the first number. 
Ok I understand the code and can use it, but it feels wrong.
Does anyone have any idea on suitable functions for such a task, both more 
size (as in code) and speed effective. It is not a mission critical, but 
moreover a opinion of what things should look like.
I've been looking into string/explode functions on php.net without getting 
past my current code.

  
-- 
---
Børge
Kennel Arivene 
http://www.arivene.net
---

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux