Jump to content

[SOLVED] explode string, but array start at 1 ?


asmith

Recommended Posts

If you insist, you could always do something like this:

 

$array = array('a','b','c','d','e');
$c = count($array);
for ($x = 1; $x <= $c; $x++) {
   $tarray[$x] = $array[$x-1];
}
$array = $tarray;

 

Though I'd personally just do the ..-1 thing already mentioned.

oh yea lol I got it now. Unfortunately the array indexes, each number has a special meaning in the script. so I wanna make less confusion.

 

CV, Thanks for the code, That's actually my last chance. I wanted to make sure there's isn't any built-in thing on php :)

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.