PHP解析脚本 [英] PHP parsing script

查看:42
本文介绍了PHP解析脚本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述




i需要编写一个php脚本解析器,但我真的没有成功写过

一个,我最后我不喜欢知道怎么做!

看起来很简单,但是我的最后一次测试是不成功的,只是我想要的是:b / b想要的是:


- 读取一个php或纯文本文件并将我们的内容存储到数组


PHP为最大数组,一行代表一个标签或;>

- 将新数组发送给foreach或while声明并更改

关键字相当于PHP或Html


- 下一步,将PHP代码发送给eval()

结果被存储或发送到输出缓冲区。

我的最后一次尝试给出了eval'代码中的错误错误,但同样单独

文件工作真的很好没有错误


感谢您的建议和帮助。


Cordialy。

Sebastien。

Hi,

i need to write a php script parser but i don''t really succes to wrote
one and i finaly i don''t know how do this !
it seems simple for sure, however my last test was unsuccessfull, just i
want to is :

- read a php or plain text file and store us content to Array

- explode and expand the first Array line by line separing Html tag and
PHP to a Biggest Array, one line for one tag or ";"

- send the new array to a "foreach" or "while" statement and change the
keywords by they equivalent in PHP or Html

- next step, send the PHP code to an eval()
the result was stored or send to the output buffer.
my last try given an "error in eval''s code" error, but the same alone
file work really fine without errors

Thank for your suggestions and helps.

Cordialy.
Sebastien.

推荐答案

4月29日上午9:39,Sebosac< sebo ... @ wanadoo.frwrote:
On Apr 29, 9:39 am, Sebosac <sebo...@wanadoo.frwrote:




i需要编写一个php脚本解析器
Hi,

i need to write a php script parser



为什么要编写php脚本解析器?你不需要一个php

解析器来解析你解析其他php

代码的php代码吗?在php.net上有没有一个不错的C ++?


你想通过解析PHP和HTML代码来实现什么?


-Mike PII

Why do you want to write a php script parser? Don''t you need a php
parser to parse the php code that you make to parse the other php
code? Isn''t there a nice C++ one at php.net?

What are you trying to accomplish by parsing PHP and HTML code?

-Mike PII


Mike P2aécrit:
Mike P2 a écrit :

4月29日,9:上午39点,Sebosac< sebo ... @ wanadoo.frwrote:
On Apr 29, 9:39 am, Sebosac <sebo...@wanadoo.frwrote:

>

我需要写一个PHP脚本解析器
>Hi,

i need to write a php script parser



为什么要编写php脚本解析器?你不需要一个php

解析器来解析你解析其他php

代码的php代码吗?在php.net上有没有一个不错的C ++?


你想通过解析PHP和HTML代码来实现什么?


-Mike PII

Why do you want to write a php script parser? Don''t you need a php
parser to parse the php code that you make to parse the other php
code? Isn''t there a nice C++ one at php.net?

What are you trying to accomplish by parsing PHP and HTML code?

-Mike PII



i写了一个CSM,大多数页面包含内部和没有该解析器的关键字

我的项目已经用完了。

i wrote a CSM, most page contain keywords inside and without that parser
my projet is out.


http://greg.chiaraquartet.net/archiv...P-finally.html
http://www.program-transformation.org/PHP/PhpFront


问候,


Henk Verhoeven,
www.phpPeanuts。 org


BTW要小心,使用eval可能会使你的应用程序难以理解为php代码

注入。


Sebosac写道:
http://greg.chiaraquartet.net/archiv...P-finally.html
http://www.program-transformation.org/PHP/PhpFront

Greetings,

Henk Verhoeven,
www.phpPeanuts.org.

BTW be carefull, using eval may make your app vurnerable to php code
injection.

Sebosac wrote:




i需要写一个php脚本解析器,但我真的没有成功写过

one and i finaly我不知道这是怎么做的!


看起来很简单,但是我的最后一次测试是不成功的,只是我想要的是:b $ b想要的是:


- 读取一个php或纯文本文件并将我们的内容存储到数组


- 爆炸并扩展第一个数组逐行分隔Html标记并且

PHP到一个最大数组,一行用于一个标签或;>


- 将新数组发送到foreach或while声明并更改

关键字相当于PHP或Html


- 下一步,将PHP代码发送给eval()


结果被存储或发送到输出缓冲区。


我的最后一次尝试给出了eval'代码中的错误错误,但同样单独

文件工作真的很好没有错误


感谢您的建议和帮助。


Cordialy。

Sebastien。
Hi,

i need to write a php script parser but i don''t really succes to wrote
one and i finaly i don''t know how do this !
it seems simple for sure, however my last test was unsuccessfull, just i
want to is :

- read a php or plain text file and store us content to Array

- explode and expand the first Array line by line separing Html tag and
PHP to a Biggest Array, one line for one tag or ";"

- send the new array to a "foreach" or "while" statement and change the
keywords by they equivalent in PHP or Html

- next step, send the PHP code to an eval()
the result was stored or send to the output buffer.
my last try given an "error in eval''s code" error, but the same alone
file work really fine without errors

Thank for your suggestions and helps.

Cordialy.
Sebastien.


这篇关于PHP解析脚本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆