php - How to remove the key in array an want to save in a string -


my html

    <input type="textbox" name="bus[]" value="">     <input type="textbox" name="bus[]" value="">     <input type="textbox" name="bus[]" value="">     <input type="textbox" name="bus[]" value=""> 

my script

$busac = $_post[bus]; $busaccount = count($busac);     if($busaccount != 0){     for($bc=0;$bc<$busaccount;$bc++){         $acbusmodel[]=array('bus'=>array('busmodel'=>array('local'=>$busrsac[$bc],'others'=>$busdollar[$bc])));     } // endforeach     }  foreach($acbusmodel $key=>$value) {             $values[$key] = $value;             $acvalue .= $value;             print_r($value);         } array ( [0] => array ( [bus] => array ( [busmodel] => array ( [local] => 1 [others] => 1 ) ) ) [1] => array ( [bus] => array ( [busmodel] => array ( [local] => 2 [others] => 2 ) ) ) [2] => array ( [bus] => array ( [busmodel] => array ( [local] => 3 [others] => 3 ) ) ) ) 

above display code

i want code this

array ( [bus] => array ( [busmodel] => array ( [local] => 1 [others] => 1 ) ) ) array ( [bus] => array ( [busmodel] => array ( [local] => 2 [others] => 2 ) ) ) array ( [bus] => array ( [busmodel] => array ( [local] => 3 [others] => 3 ) ) )

i want save value in single string..

if understand correctly need

replace print_r($value)

with

$c = count($value); $fin=''; for($ =0;$i<$c;$i++) {      $fin .=print_r($value[i],true); // print variable (not on browser)  } 

Comments

Popular posts from this blog

c# - Operator '==' incompatible with operand types 'Guid' and 'Guid' using DynamicExpression.ParseLambda<T, bool> -