S

@SudhirGour

rsort

PHP
3 years ago
<?php $newArray = [1,2,3,4,5,6,7,8]; rsort($newArray); print_r($newArray);

sort

PHP
3 years ago
<?php $arrayNewKeys = [ "first_name" => "Sudhir", "last_lname" => "Gour", "new_age" => 27, "city" => "Jaipur", "state" => "Rajasthan", "country" => "India" ];

count

PHP
3 years ago
<?php $arrayNewKeys = [ "first_name" => "Sudhir", "last_lname" => "Gour", "new_age" => 27, "city" => "Jaipur", "state" => "Jaipur", "country" => "India" ];

array_fill_keys

PHP
3 years ago
<?php $arrayKeys = ["fname" , "lname" , "city" , "country"]; print_r(array_fill_keys($arrayKeys , "Mango"));

array_fill

PHP
3 years ago
<?php print_r(array_fill(1, 10 , "banana"));

array_diff_key

PHP
3 years ago
<?php $myArray = [ "fname" => "Sudhir", "lname" => "Gour", "age" => 27, "city" => "Jaipur", "state" => "Jaipur", "country" => "India" ];

array_diff

PHP
3 years ago
<?php $arrayKeys = ["fname" , "lname" , "city" , "country"]; $arrayValues = ["Sudhir" , "Gour" , "Jaipur" , "India"]; print_r(array_diff($arrayKeys , $arrayValues)); // returns the elements of first array that don't match in the other arrays.

array_count_values

PHP
3 years ago
<?php $arrayValues = ["Sudhir" , "Gour" , "Jaipur" , "India"]; print_r(array_count_values($arrayValues));

array_combine

PHP
3 years ago
<?php $arrayKeys = ["fname" , "lname" , "city" , "country"]; $arrayValues = ["Sudhir" , "Gour" , "Jaipur" , "India"]; print_r(array_combine($arrayKeys , $arrayValues));

array_column

PHP
3 years ago
<?php $myArrayTwo = array( "firstArray" => array( "FName" => "Sudhir", "firstLName" =>"Gour", "firstAge" => 32 ), "secondArray" => array( "FName" => "Kartik",

array_change_key_case

PHP
3 years ago
<?php $myArray = [ "fname" => "Sudhir", "lname" => "Gour", "age" => 27, "city" => "Jaipur", "state" => "Jaipur", "country" => "India" ];

array_chunk

PHP
3 years ago
<?php $myArray = [ "fname" => "Sudhir", "lname" => "Gour", "age" => 27, "city" => "Jaipur", "state" => "Jaipur",

R

PHP
3 years ago
<?php // All Arrays which will be used : // $arrayTrad = ["Sudhir" , 23 , true , 12.3]; $arrayNew = [ "Sudhir" , "lname" => "gour", 3 ];

Method_Overloading

PHP
3 years ago
<?php class Overload{ const pi = 3.141432; public function __call($methodName , $arguments){ switch(count($arguments)){ case 0 : return 0;

Static_Members

PHP
3 years ago
<?php class One{ public $name = "Sudhir Gour"; public function showName(){ echo "This is my Name : $this->name \n"; echo "This access method doesn't work : " . self::$name; } }

Method_Overriding

PHP
3 years ago
<?php class A{ public $name = "Sudhir Gour"; public function show(){ echo "Sudhir"; } public function calc($a , $b){ return $a * $b;

Interfaces

PHP
3 years ago
<?php interface I1{ // public function __construct(){ // echo "We cannot have constructors in interfaces"; // } public function greet($name); }

Abstract_Class

PHP
3 years ago
<?php abstract class First{ protected $author; private $price; public function __construct($author , $price){ $this->author = $author; $this->price = $price;

Constant_Properties

PHP
3 years ago
<?php class StaticMessage{ const message = "This is the constant method"; public function showMessage(){ // echo $this->message; This throws an error. // or echo SELF::message . PHP_EOL; }

Single_Inheritance

PHP
3 years ago
<?php class parents{ public $color , $lastName; protected $DNA; public function __construct($color , $lastName, $DNA){ $this->color = $color; $this->lastName = $lastName; $this->DNA = $DNA;