-1

Here is my code

$value = ["300","200","400","500"];

$remove = "300"; 

I want $value as ["200","400","500"];

please answer to this

Jay Blanchard
  • 34,243
  • 16
  • 77
  • 119
phani
  • 9

1 Answers1

3

You can use array_shift() as it will remove the first item in an array:

$value = ["300","200","400","500"];
$remove = array_shift($value);
print_r($value);

This will return:

Array
(
    [0] => 200
    [1] => 400
    [2] => 500
)
Jay Blanchard
  • 34,243
  • 16
  • 77
  • 119