• We are available for any Development work:
  • Email us at: programmer_heart@yahoo.com

How to add new item to beginning of array in php

You can do this by following little code in php
$arr = array('value1','value2');
array_unshift($arr, "value0");
The above example will output:
[0] =>value0
[1] =>value1
[2] =>value2

Leave a Reply

Your email address will not be published. Required fields are marked *

Current day month ye@r *

Press Enter to Search