Home > Backend Development > PHP Tutorial > 改键不改值 求优雅的方法

改键不改值 求优雅的方法

WBOY
Release: 2016-06-06 20:24:16
Original
1218 people have browsed it

<code>[0] => Array
        (
            [id] => 115
            [create_time] => 2小时前
            [content] => XXXXXXXXXXXXXX
        )</code>
Copy after login
Copy after login

除了先插入后删除的方法,有没有比较优雅的方法把这里的id键变成comment_id

回复内容:

<code>[0] => Array
        (
            [id] => 115
            [create_time] => 2小时前
            [content] => XXXXXXXXXXXXXX
        )</code>
Copy after login
Copy after login

除了先插入后删除的方法,有没有比较优雅的方法把这里的id键变成comment_id

没有了, 其他方法都没直接遍历修改的性能好。

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