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

Answer Posted / dhir

<?php
$a[0]='a';
$a[1]='b';
$a[2]='c';
$a[3]='d';
$a[4]='f';
$a[5]='g';
$a[6]='h';
$a[7]='i';

for($b=0;$b<=4;$b++)
{
$a=shift($a[$b]);
}
?>

Is This Answer Correct ?    1 Yes 3 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is csrf token in php?

548


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

503


Tell me can the value of a constant change during the script's execution?

569


When do sessions end?

541


Is php easier than node?

519






What is the sign to start variables in PHP?

590


Tell me what is the definition of a session?

550


What is rest api in php?

512


What is php and what does it do?

539


Which is better get or post method?

457


what is PDO?

799


How to move uploaded files to permanent directory?

534


What is difference between strstr() and stristr() in PHP?

541


Code to open file download dialog in PHP?

548


Write an example to remove html tags from a string in php?

519