PHP code example of yyxx9988 / html-wxml-converter
1. Go to this page and download the library: Download yyxx9988/html-wxml-converter library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
yyxx9988 / html-wxml-converter example snippets
use \yyxx9988\mlconverter\Converter;
$converter = new Converter();
$converter->setHtml('
<div>
<a>...</a>
<p><img src="..."></p>
</div>
');
echo $converter->convert();
// result
<view data-htmltag="div">
<view data-htmltag="a">...</view>
<view data-htmltag="p"><image src="..."></image></view>
</view>
$converter = new Converter();
// add a tag
$converter->addHtmlTags('xxx', 'view');
// change a tag
$converter->setHtmlTags('li', 'text');
// remove a tag
$converter->removeHtmlTags('article');
echo $converter->convert();
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.