Jump to content

bruceblacklaws

New Members
  • Posts

    2
  • Joined

  • Last visited

bruceblacklaws's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Thanks. That worked. $a = [ "1" => "test1", "2" => "test2", "3" => "test3", "4" => "test4", "5" => "test5", "6" => "test6", "7" => "test7", "8" => "test8", "9" => "test9", "10" => "test10", "11" => "test11", "12" => "test12", "13" => "test13", "14" => "test14", "15" => "test15", "16" => "test16", "17" => "test17", "18" => "test18", "19" => "test19", "20" => "test20" ]; array_splice($a, 1, -10); print_r($a);
  2. I'm looking for a way to remove all but the last 10 elements in an array. Is it possible to do this with array_splice? I have an array with greater than 1000 elements and I don't want to have to specify each element I want to remove. It would be cool if I could do something like "remove elements 1-990".
×
×
  • 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.