Welcome Guest.

8Answers

How does php split an array into two strings?

Asked by: Helen Wright 241 views IT November 27, 2018

Figure

8 Answers

  1. +7Votes  

    One-dimensional arrays are converted to string code!
    <?php
    $arr1=array(“shu”,”zhu”,”1″);
    $c=implode(“

    Frances Phillips- November 27, 2018 |

  2. +3Votes  

    “,$arr1);
    echo $ c;  //shu

    Brian- November 27, 2018 |

  3. +2Votes  

    zhu

    Douglas Green- November 28, 2018 |

  4. +8Votes  

    1
    ?>
    Two-dimensional array converted to string code
    <?php
    $arr=array(array(“hu” ,”peng”,”123456″));
    $b=implode(“

    Roger- November 28, 2018 |

  5. +4Votes  

    “,$arr[0]);
    echo $b; //hu

    Dorothy Allen- November 28, 2018 |

  6. +6Votes  

    peng

    Cooper- November 29, 2018 |

  7. +3Votes  

    123456?>

    Shirley Jackson- November 29, 2018 |

  8. +2Votes  

    /* Converting a two-dimensional array to a string is actually very simple. Use a for loop to correct the two-dimensional array $arr you read, such as Array ( [0] = > Array ( [name] => Industry) [1] => Array ( [name] => Forum) ) Code Start */$sum = 0; $count = count($arr);for($ i = 0; $i < $count; $i++){      $sum .= $arr[$i][‘name’];}$sum = substr($sum,1);echo ($sum);

    Walker- November 29, 2018 |