adduc / cdata-simplexml
Wrapper around SimpleXMLElement to provide cdata support.
1.0.0
2018-08-05 08:51 UTC
Requires
- php: >=7.0
- ext-simplexml: *
Requires (Dev)
- adduc/coding-standards: dev-master
- jakub-onderka/php-parallel-lint: ^1.0
- phpunit/phpunit: ^7.3
- squizlabs/php_codesniffer: ^3.3
This package is not auto-updated.
Last update: 2024-11-08 13:29:40 UTC
README
This library adds a wrapper around the SimpleXMLElement class to allow creating CDATA elements.
Usage
<?php
use Adduc\SimpleXMLElement;
$data = '<test/>';
$xml = new SimpleXMLElement($data);
$xml->addCData('element', 'Test Data');
echo $xml->asXml();
// <test><element><![CDATA[Test Data]]></element></test>