Search
 
SCRIPT & CODE EXAMPLE
 

PHP

function passing multiple arguments using 3 dots php

function concatenate($transform, ...$strings) {
    $string = '';
    foreach($strings as $piece) {
        $string .= $piece;
    }
    return($transform($string));
}

echo concatenate("strtoupper", "I'd ", "like ", 4 + 2, " apples");
// This would print:
// I'D LIKE 6 APPLES
Comment

PREVIOUS NEXT
Code Example
Php :: laravel where in array 
Php :: header php location 
Php :: null value in php 
Php :: composer create new laravel project 
Php :: __invoke in laravel 
Php :: php post variables to another page with submit button php 
Php :: laravel echo html 
Php :: How do I get current taxonomy "term id" on wordpress? 
Php :: laravel migrations generator laravel 
Php :: php invoke 
Php :: convert datetime to string in php 
Php :: stripslashes 
Php :: get category of current post wordpress 
Php :: laravel foreach loop index in controller 
Php :: fakher ul islam khan 
Php :: php exec get pid 
Php :: ci constructor 
Php :: update laravel 
Php :: laravel route required parameters 
Php :: database seeder laravel 
Php :: leftJoinSub laravel 
Php :: php substr 
Php :: collection get first element laravel 
Php :: laravel on cascade set null 
Php :: symfony messenger config 
Php :: php foreach loop 
Php :: IlluminateContractsContainerBindingResolutionException 
Php :: logout from all the devices in the jwt api laravel 
Php :: laravel redis cache 
Php :: laravel s3 download file 
ADD CONTENT
Topic
Content
Source link
Name
9+6 =