PHP slice array php - Net-Raft.com

Welcome aboard! We are happy you are here and wish you good net-raft!




Just a Web Code Solution

slice an array using php


 271

Show ResultPHP


1

<!DOCTYPE html>
<html>
<body>

<?php

$input = array("a", "b", "c", "d", "e");

$output1 = array_slice($input, 2);
$output2 = array_slice($input, -2, 1);
$output3 = array_slice($input, 0, 3);

print_r($output1);

echo "<br>";

print_r($output2);

echo "<br>";

print_r($output3);


?>

</body>
</html>


By     Created   
The power of the user (%)
5%



The most helpful PHP solutions

detect browser phpdetect browser phpPHP

Click to see more ...

  3.7K     388

create QR code phpcreate QR code phpPHP

Click to see more ...

  2.3K     274

delete array item phpdelete array item phpPHP

Click to see more ...

  1.9K     231

create relative date phpcreate relative date phpPHP

Click to see more ...

  1.6K     216

detect ie phpdetect ie phpPHP

Click to see more ...

  1.2K     209

get current url phpget current url phpPHP

Click to see more ...

  833     189

Get real client country using php ?Get real client country using php ?PHP

Click to see more ...

  667     169

drag and drop upload file using phpdrag and drop upload file using phpPHP

Click to see more ...

  1.7K     143

get meta tag phpget meta tag phpPHP

Click to see more ...

  582     129

detect speed internet phpdetect speed internet phpPHP

Click to see more ...

  559     106