how to display the value separate into string, integer and double in php -


how can display value separate string, integer , double in php using multidimensional array?

here's code:

<?php $array = array(     array ("one"=>1,"two"=>"two","three"=>3.1,"four"=>4,"five"=>"five"),     array ("six"=>6.1,"seven"=>7,"eight"=>"eight","nine"=>9.1,"ten"=>10),     array ("eleven"=>"eleven","twelve"=>12.1,"thirteen"=>13,"fourteen"=>"fourteen","fifteen"=>15.1),     array ("sixteen"=>16,"seventeen"=>"seventeen","eighteen"=>18.1,"nineteen"=> 19,"twenty"=>"twenty"),     array ("twenty-one"=>21.1,"twenty-two"=>22,"twenty-three"=>"twenty-three","twenty-four"=>24.1,"twenty-five"=>25) ); 

use 2 foreach statement, 1 each array , 1 loop value , use switch/case determine value , according add value array of type

$integer=array(); $double=array(); $string=array() foreach ($rows $row) { foreach($row $key=>$value){ switch (true){     case is_string($value):         // string $string[]=$value;         break;     case is_int($value):         // int $integer[]=$value;         break;     case is_float($value);        // double  $double[]=$value;        break; default: } } } 

Comments

Popular posts from this blog

resizing Telegram inline keyboard -

command line - How can a Python program background itself? -

php - "cURL error 28: Resolving timed out" on Wordpress on Azure App Service on Linux -