Home > Backend Development > PHP Tutorial > 关于PHP数组的问题

关于PHP数组的问题

WBOY
Release: 2016-06-23 14:28:16
Original
827 people have browsed it

数组:
 111:222
 333:444
 555:666

如何利用PHP重组为以下

  • 111:222
  • 333:444
  • 555:666


  • 请高手函数该怎么写帮忙写一下 谢谢。

    回复讨论(解决方案)

    请把数组原型给输出来看看... 遍历数组拼装. 

    请把数组原型给输出来看看... 遍历数组拼装. 

    原型就是  

    $yx = ' 111:222
     333:444
     555:666
    ';
    下面该怎么写啊。麻烦高手帮忙写一下遍历数组拼装。谢谢

    这不是数组而是字符串

    $yx = ' 111:222</br> 333:444</br> 555:666</br>';echo preg_replace(array('/br/', '/ /'), array('li', '<li>'), $yx);
    Copy after login
    Copy after login
  • 111:222

  • 333:444

  • 555:666

  • 这不是数组而是字符串

    $yx = ' 111:222</br> 333:444</br> 555:666</br>';echo preg_replace(array('/br/', '/ /'), array('li', '<li>'), $yx);
    Copy after login
    Copy after login

  • 111:222

  • 333:444

  • 555:666


  • 看了你的方法 给我的感觉就是  我能多学个函数 就能少些好多代码。。
    Related labels:
    source:php.cn
    Statement of this Website
    The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
    Popular Tutorials
    More>
    Latest Downloads
    More>
    Web Effects
    Website Source Code
    Website Materials
    Front End Template