I'm reading in a file name, and need to explode the name into letters and numbers....an example might make this easier to digest
Original Name #1 - m1n1p1.php
Original Name #2 - m32n1p12.php
After removing the extension...I need a way of splitting the string so that the numbers stay together, and the alpha stay together...
So I'd love it if it looked something like this
$on1[1] = m
$on1[2] = 1
$on1[3] = n
$on1[4] = 1
$on1[5] = p
$on1[6] = 1
And here's where it gets tricky
$on1[1] = m
$on1[2] = 32
$on1[3] = n
$on1[4] = 1
$on1[5] = p
$on1[6] = 12
Is there a way of doing this? Or am asking for more trouble?
Solution found: thanks
zimzat
Original Name #1 - m1n1p1.php
Original Name #2 - m32n1p12.php
After removing the extension...I need a way of splitting the string so that the numbers stay together, and the alpha stay together...
So I'd love it if it looked something like this
$on1[1] = m
$on1[2] = 1
$on1[3] = n
$on1[4] = 1
$on1[5] = p
$on1[6] = 1
And here's where it gets tricky
$on1[1] = m
$on1[2] = 32
$on1[3] = n
$on1[4] = 1
$on1[5] = p
$on1[6] = 12
Solution found: thanks
