I have 10 elements of Array, how can i remove 5 array
element, with single function.

Answer Posted / vipul dalwala

$a = array('a','b','c','d','f','g','h','i','j','k');

array_splice($a, 0, 5);

Is This Answer Correct ?    12 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are the rules to declare a php variables?

501


What is array and function?

513


Which function would you use to format date information in php?

534


What is the difference between associative array and indexed array?

487


How can you declare a constant variable in php?

548






Tell me how is it possible to parse a configuration file?

492


What is "print" in php?

507


How to execute an sql query? How to fetch its result?

558


Is key in array php?

570


What is the difference between php4 and php5?

550


What is mysqli_query?

491


Do you know design patterns. List few?

511


How would you open a directory for reading in php?

549


Why shouldn't I use mysql_* functions in php?

561


What is an associative array?

529