64

PHPer这样写代码也许更优雅

 5 years ago
source link: https://juejin.im/post/5b2b9bbfe51d45587d2dd667
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
前言 转眼间成为一名PHPer已经快整整两年了,在这期间也对如何写出可读性高,便于扩展的代码有了一些自己的想法。 使用引用 场景一:遍历一个数组获取新的数据结构 也许你会这样写: // 申明一个新的数组,组装成你想要的数据 $tmp = []; foreach

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK