Posts

MY OWN EXPLANATION OF THE CONCEPTS OF ARRAY_MERGE() FUNCTION AND ARRAY_COMBINE() FUNCTION ALONG WITH ONE EXAMPLE "TAKE 4 ARRAYS THEN MERGE THE ARRAYS USING ARRAY_COMBINE() FUNCTION" USING BOOTSTRAP-5 CLASSES IN HTML AND PHP (COMMONLY USED IN CRUD OPERATION WHILE WORKING IN LIVE PROJECTS IN INDUSTRY AS A PHP WEB DEVELOPER)

Image
 MY OWN EXPLANATION OF THE CONCEPTS OF ARRAY_MERGE() FUNCTION AND ARRAY_COMBINE() FUNCTION ALONG WITH ONE EXAMPLE "TAKE 4 ARRAYS THEN MERGE THE ARRAYS USING ARRAY_COMBINE() FUNCTION" USING BOOTSTRAP-5 CLASSES IN HTML AND PHP (COMMONLY USED IN CRUD OPERATION WHILE WORKING IN LIVE PROJECTS IN INDUSTRY AS A PHP WEB DEVELOPER) Hi Guys, Very good evening to all of you. So, today I am going to explain about the comcepts of array_merge() and array_combine() function using one example and also I am going to explain about the Bootstrap-5 classes which I have used in my example of array_merge() and array_combine() function.           So, without wasting any more time let's begin with the explanation.             Firstly, I am explaining about the concept of array_combine() function. So, array_combine() function is the function which can merge two arrays into one array. And array_combine() function should be of same size or same valu...

Programmings Based On Array And String Functions To Merge The 2 Arrays, Then After Merge Convert Into String And Then Find Out The 1st And Last Word From The Reverse String

Image
  Programmings Based On Array And String Functions To Merge The 2 Arrays, Then After Merge Convert Into String And Then Find Out The 1st And Last Word From The Reverse String Q1. Take 2 arrays then margin the arrays. After margin convert into string then reverse the string and find out 1st and last word from the reverse string. Ans: Coding => <?php $arr1 =[ "Dhoni" , "Rohit" , "Kohli" , "Rahul" ]; $arr2 =[ "Bumrah" , "Shami" , "Siraj" , "Chahal" ]; $arrmer = array_merge ( $arr1 , $arr2 ); print_r ( $arrmer ); echo "<br>" ; $str = implode ( " " , $arrmer ); print_r ( $str ); echo "<br>" ; $strrev = strrev ( $str ); print_r ( $strrev ); echo "<br>" ; $arr = explode ( " " , $strrev ); print_r ( $arr ); echo "<br>" ; $firstword = array_shift ( $arr ); $lastword = array_pop ( $arr ); print_r ( $firstword ); echo "...

Programmings Based On Array And String Functions To Find How Many Numbers Of Positive, Negative And Zero Numbers Present In The Array $arr=array(-1,-2,-3,-4,0,0,1,2,3,4)

Image
Programmings Based On Array And String Functions To Find How Many Numbers Of Positive, Negative And Zero Numbers Present In The Array $arr=array(-1,-2,-3,-4,0,0,1,2,3,4) Q1. Find how many numbers of Positive, Negative, 0 numbers present in this array. $arr=array(-1,-2,-3,-4,0,0,1,2,3,4) Ans: Coding => <?php $arr = array (- 1 ,- 2 ,- 3 ,- 4 , 0 , 0 , 1 , 2 , 3 , 4 ); $pn = 0 ; $nn = 0 ; $zn = 0 ; $len = count ( $arr ); for ( $i = 0 ; $i < $len ; $i ++) {     if ( $arr [ $i ]> 0 ) {         $pn ++;     }     else if ( $arr [ $i ]< 0 ) {         $nn ++;     }     else {         $zn ++;     } } echo "The positive number present in the array is: " . $pn . "<br>" ; echo "The negative number present in the array is: " . $nn . "<br>" ; echo "The zero number present in the array is: " . $zn ; ? > Output Of The Coding => Explanation Of Th...

Programmings Based On Array And String Functions Including Printing The Array Using Echo, Finding Out The 1st And Last Word In A Sentence, Finding Out The 1st Alphabet From A String And Also To Check Whether My Variable Is In Form Of Array Or Not

Image
Programmings Based On Array And String Functions Including Printing The Array Using Echo Where We Cannot Concatenate The Index Number, Finding Out The 1st And Last Word In A Sentence, Finding Out The 1st Alphabet From A String And Also To Check Whether My Variable Is In Form Of Array Or Not Q1. Print the array using echo where ou cannot concatinate the index number. Ans: Coding Example No. - 01 => <?php $arr =[ "500" , "1000" , "1500" , "2000" ]; $len = count ( $arr ); for ( $i = 0 ; $i < $len ; $i ++) {     echo " $arr [ $i ]" ; } ? > <?php $arr =[ "500" , "1000" , "1500" , "2000" ]; $len = count ( $arr ); for ( $i = 0 ; $i < $len ; $i ++) {     echo " $arr [ $i ]" . "<br>" ; } ? > Output Of The Coding Example No. - 01 => Coding Example No. - 02 => <?php $arrayName = array ( '100' , '200' , '300' , '400...

Full Concepts On array_flip() Function With 3 Coding Examples Prepared By Me Of Array Functions In PHP

Image
Full Concepts On array_flip() Function With 3 Coding Examples Prepared By Me Of Array Functions In PHP Q1. What is meant by array_flip()? Ans: array_flip() function is the swapping between keys and values. Coding Example 1 of array_flip() function => <?php $arrayName = array ( 'Name' => 'Ratan Tata' , 'Founder' => 'TCS' ); $arrflip = array_flip ( $arrayName ); print_r ( $arrflip ); ? > Example Of Coding Example 1 of array_flip() function => Coding Example 2 of array_flip() function => <?php $arrayName = array ( 'Name' => 'Parnashri' , 'Age' => '22' , 'Company' => 'RPS Solution' ); $arrflip = array_flip ( $arrayName ); print_r ( $arrflip ); ? > Example Of Coding Example 2 of array_flip() function => Coding Example 3 of array_flip() function => <?php $arrayName = array('Name Of The Series' => 'Money Heist', 'Release Date' => ...

MINI PROJECT ON USER INPUT TRACKER (STORE FORM SUBMISSIONS (LIKE FEEDBACK OR SURVEY DATA) IN AN ASSOCIATIVE ARRAY AND DISPLAY ONLY THE FIELDS (KEYS) THAT WERE FILLED OUT BY THE USER) AND TO GET ALL SUBMITTED FIELD NAMES FROM THE USER INPUT BY USING ARRAY_KEYS() FUNCTION

Image
MINI PROJECT ON USER INPUT TRACKER  BY USING ARRAY_KEYS() FUNCTION (STORE FORM SUBMISSIONS (LIKE FEEDBACK OR SURVEY DATA) IN AN ASSOCIATIVE ARRAY AND DISPLAY ONLY THE FIELDS (KEYS) THAT WERE FILLED OUT BY THE USER) AND TO GET ALL SUBMITTED FIELD NAMES FROM THE USER INPUT BY USING ARRAY_KEYS() FUNCTION STEP 1: In my first step first I have created an HTML form where I have design a simple html form which html file I have named it as userinputtracker.html file with multiple input fields like Name, Email, Age And Feedback Message with button submit along with method post as because the post method is the most secure method so that it can send the data securely and with action as thankyou page i.e. thatnkyou.php. I have provided name attributes in each input fields so that it can be accessed in PHP. <! DOCTYPE html > < html > < head >     < meta charset = "utf-8" >     < meta name = "viewport" content = "width=device-width, initial-sc...

Full Concepts On array_keys() Function With 3 Coding Examples Prepared By Me Of Array Functions In PHP

Image
Full Concepts On array_keys() Function With 3 Coding Examples Prepared By Me Of Array Functions In PHP Q1. What is meant by array_keys()? Ans: array_keys() returns an array containing the keys. Coding Example : 01 => <?php $arrayName = array ( 'name' => 'Ayan' , 'age' => '28' , 'gender' => 'male' ); $arrkeys = array_keys ( $arrayName ); print_r ( $arrkeys ); ? > Output Of The Coding Example : 01 => Coding Example : 02 => <?php $arrayName = array ( 'Company Name' => 'Capgemini' , 'Established Year' => '1967' ); $arrkeys = array_keys ( $arrayName ); print_r ( $arrkeys ); ? > Output Of The Coding Example : 02 => Coding Example : 03 => <?php $arrayName = array ( 'Name of the cricketer' => 'M.S.Dhoni' , 'Team' => 'India' ); $arrkeys = array_keys ( $arrayName ); print_r ( $arrkeys ); ? > Output Of The Coding Example : ...