PHP 8.5.0 Beta 3 available for testing

DOMEntityReference::__construct

(PHP 5, PHP 7, PHP 8)

DOMEntityReference::__construct โ€” ๆ–ฐใ—ใ„ DOMEntityReference ใ‚ชใƒ–ใ‚ธใ‚งใ‚ฏใƒˆใ‚’ไฝœๆˆใ™ใ‚‹

่ชฌๆ˜Ž

public DOMEntityReference::__construct(string $name)

ๆ–ฐใ—ใ„ DOMEntityReference ใ‚ชใƒ–ใ‚ธใ‚งใ‚ฏใƒˆใ‚’ไฝœๆˆใ—ใพใ™ใ€‚

ใƒ‘ใƒฉใƒกใƒผใ‚ฟ

name

ใ‚จใƒณใƒ†ใ‚ฃใƒ†ใ‚ฃๅ‚็…งใฎๅๅ‰ใ€‚

ไพ‹

ไพ‹1 ๆ–ฐใ—ใ„ DOMEntityReference ใ‚’ไฝœๆˆใ™ใ‚‹

<?php

$dom
= new DOMDocument('1.0', 'iso-8859-1');
$element = $dom->appendChild(new DOMElement('root'));
$entity = $element->appendChild(new DOMEntityReference('nbsp'));
echo
$dom->saveXML(); /* <?xml version="1.0" encoding="iso-8859-1"?><root>&nbsp;</root> */

?>

ๅ‚่€ƒ

  • DOMDocument::createEntityReference() - ๆ–ฐใ—ใ„ใ‚จใƒณใƒ†ใ‚ฃใƒ†ใ‚ฃๅ‚็…งใƒŽใƒผใƒ‰ใ‚’ไฝœๆˆใ™ใ‚‹

๏ผ‹add a note

User Contributed Notes

There are no user contributed notes for this page.
To Top