jphps
TypeScript icon, indicating that this package has built-in type declarations

1.0.3 • Public • Published

jphps(<%>)

NPM version Build Status Coverage Status

处理前

function renderItem($item) {
  if (isset($item)) {
  <li>
    <a href="!#{$item['url']}">#{$item['title']}</a>
  </li>
  }
}
 
<ul>
renderItem(array('url' => 'http://google.com/', 'title' => 'Google'));
renderItem(array('url' => 'http://www.baidu.com/', 'title' => '百度'));
</ul>

处理后

<?php function renderItem($item) {
  if (isset($item)) { ?> 
  <li>
    <a href="<?php echo $item['url'] ?>"><?php echo htmlentities($item['title']?></a>
  </li>
<?php   }
} ?> 
 
<ul>
<?php renderItem(array('url' => 'http://google.com/''title' => 'Google'));
renderItem(array('url' => 'http://www.baidu.com/''title' => '百度')); ?> 
</ul>

运行后

 
<ul>
  <li>
    <a href="http://google.com/">Google</a>
  </li>
  <li>
    <a href="http://www.baidu.com/">百度</a>
  </li>
</ul>

License

MIT © zswang

Readme

Keywords

Package Sidebar

Install

npm i jphps

Homepage

jphps.com/

Weekly Downloads

10

Version

1.0.3

License

MIT

Last publish

Collaborators

  • zswang