Skip to content

Commit 8ae9c2c

Browse files
committed
toml
1 parent 8400ad8 commit 8ae9c2c

2 files changed

Lines changed: 30 additions & 1 deletion

File tree

Php/Toml/Array2Toml.php

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
<?php
2+
3+
class Array2Toml
4+
{
5+
private $arr = [];
6+
private $result = "";
7+
8+
public function __construct($arr = [])
9+
{
10+
$this->arr = $arr;
11+
}
12+
13+
public function run()
14+
{
15+
foreach ($this->arr as $key => $value) {
16+
if (!empty($value) && is_string($value)) {
17+
$this->result = $this->result.sprintf("[\"%s\"]\r\none = \"%s\"\r\nother = \"%s\"\r\n", $key, $value, $value);
18+
}
19+
}
20+
21+
echo $this->result;
22+
}
23+
}
24+
25+
$a2t = new Array2Toml();
26+
$a2t->run();

README.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -190,6 +190,8 @@
190190
- [rustdesk:类似TeamVeiwer的远程桌面工具,提供免费中继服务器,也可自己搭建](https://github.com/rustdesk/rustdesk)
191191
###### C
192192
- [一款消息队列产品:beanstalkd](https://github.com/beanstalkd/beanstalkd)
193+
###### Rust
194+
- [lapce - 开源IDE](https://github.com/lapce/lapce)
193195
###### Python
194196
- [路径规划算法:PathPlanning](https://github.com/zhm-real/PathPlanning)
195197
- [各语言的帮助文档快速查询:cheat.sh](https://github.com/chubin/cheat.sh)
@@ -267,4 +269,5 @@
267269
###### 其他
268270
- [awesome-graphql](https://github.com/chentsulin/awesome-graphql)
269271
- [IoT入门学习](https://github.com/microsoft/IoT-For-Beginners)
270-
- [硬件](https://github.com/flipperdevices/flipperzero-firmware)
272+
- [硬件](https://github.com/flipperdevices/flipperzero-firmware)
273+
- [从零创建游戏引擎](https://github.com/ThisisGame/cpp-game-engine-book)

0 commit comments

Comments
 (0)