Skip to content

Commit c1c1e12

Browse files
author
zhuxiaojie
committed
modify ip2long implementation
1 parent e397784 commit c1c1e12

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

docs/03.PHP/QA.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -337,6 +337,15 @@ PHP 代码 => 启动 php 及 zend 引擎,加载注册拓展模块 => 对代码
337337

338338
![ip2long](./assets/php-ip2long.png)
339339

340+
341+
```
342+
124.205.30.150=2093817494
343+
344+
list($p1,$p2,$p3,$p4) = explode(',','124.205.30.150');
345+
346+
$realNum = $p1<<24+$p2<<16+$p3<<8+$p4;
347+
```
348+
340349
### MVC 的理解
341350

342351
MVC 包括三类对象。模型 Model 是应用对象,视图 View 是它在屏幕上的表示,控制器 Controller 定义用户界面对用户输入的响应方式。不使用 MVC,用户界面设计往往将这些对象混在一起,而 MVC 则将它们分离以提高灵活性和复用性

docs/03.PHP/assets/php-ip2long.png

5.75 KB
Loading

0 commit comments

Comments
 (0)