Parsing and Printing PHP Code

后端 未结 3 1318
南旧
南旧 2021-01-22 05:44

Preferably I\'d like a solution which allows me to parse PHP from PHP, but any solution is welcome. (As an example of what I\'m looking for, Ruby has the - amongst othe

3条回答
  •  孤独总比滥情好
    2021-01-22 06:35

    Edit: this answer was written before @pepjin edited their question and changed the requirements. See comments for context.


    eval() to execute PHP code from within PHP.

    To analyse PHP code for your own micro language etc you can use the PHP Tokenizer. List of parser tokens: http://www.php.net/manual/en/tokens.php

提交回复
热议问题