Change language

PHP Ds / Sequence unshift () function

Syntax:
void abstract public DsSequence::unshift ($values)
Parameters: this function takes one parameter, $values, which contains the values ​​to add to the font sequence.Return value:This function does not return any values .The following programs illustrate the Ds / Sequence::unshift()function in PHP:Program 1:  
// Create a new sequence $seq = new DsVector ([12, 15, 18, 20]);  
// Use the unshift() function for
// sequence element $seq -> unshift ( "Geeks" ); $seq -> unshift ( " 1 " , 1); print_r ( $seq );  
?>
Output:
DsVector Object ([0] = > 1 [1] = > 1 [2] = > Geeks [3] = > 12 [4] = > 15 [5] = > 18 [ 6] = > 20)
Program 2:  
// Create a new sequence $seq = new DsVector ([ "Geeks" , "for" , "Geeks" ]);  
// Use the unshift() function for
// sequence element $seq -> unshift (1); $seq -> unshift ( " G " , 10); var_dump ( $seq );  
?>
Output:
object (DsVector) # 1 (6) {[0] = > string (1) "G" [1] = > int (10) [2] = > int (1) [3] = > string (5) "Geeks" [4] = > string (3) "for" [5] = > string (5) "Geeks"}
Link: http: //php.net/manual/en/ds-sequence.unshift.php

Shop

Learn programming in R: courses

$

Best Python online courses for 2022

$

Best laptop for Fortnite

$

Best laptop for Excel

$

Best laptop for Solidworks

$

Best laptop for Roblox

$

Best computer for crypto mining

$

Best laptop for Sims 4

$

Latest questions

NUMPYNUMPY

psycopg2: insert multiple rows with one query

12 answers

NUMPYNUMPY

How to convert Nonetype to int or string?

12 answers

NUMPYNUMPY

How to specify multiple return types using type-hints

12 answers

NUMPYNUMPY

Javascript Error: IPython is not defined in JupyterLab

12 answers


Wiki

Python OpenCV | cv2.putText () method

numpy.arctan2 () in Python

Python | os.path.realpath () method

Python OpenCV | cv2.circle () method

Python OpenCV cv2.cvtColor () method

Python - Move item to the end of the list

time.perf_counter () function in Python

Check if one list is a subset of another in Python

Python os.path.join () method