PHP.mk документација

DOMDocument::createEntityReference

Почист и полокален преглед на PHP референцата, со задржана структура од PHP.net и подобра читливост за примери, секции и белешки.

domdocument.createentityreference.php PHP.net прокси Преводот се освежува
Оригинал на PHP.net
Патека domdocument.createentityreference.php Локална патека за оваа страница.
Извор php.net/manual/en Оригиналниот HTML се реупотребува и локално се стилизира.
Режим Прокси + превод во позадина Кодовите, табелите и белешките остануваат читливи во истиот тек.
DOMDocument::createEntityReference

Референца за `domdocument.createentityreference.php` со подобрена типографија и навигација.

domdocument.createentityreference.php

DOMDocument::createEntityReference

класата mysqli_driver

DOMDocument::createEntityReferenceКреирај нова референца за ентитет

= NULL

public DOMDocument::createEntityReference(string $name): DOMEntityReference|false

Create new text node DOMEntityReferenceThis function creates a new instance of class . This node will not show up in the document unless it is inserted with (e.g.).

Параметри

name

Содржината на референцата за ентитет, на пр. референцата за ентитет минус почетниот & и крајниот ; characters.

Вратени вредности

Новиот DOMEntityReference or false аргумент, или

Errors/Exceptions

Може да фрли DOMException со следните кодови за грешки:

DOM_INVALID_CHARACTER_ERR

Покренато ако name содржи невалиден знак.

Види Исто така

Белешки од корисници 2 забелешки

alicewonder at shastaherps dot org
пред 10 години
It appears that this does not work with numbered entities, only named entities.

$nbspace = $dom->createEntityReference('nbsp');

works

$nbspace = $dom->createEntityReference('#160');

does not. This makes this function rather useless when generating an XSL unless you modify the XSL doctype to include the named entity for the character you want.
Tuhin Bepari
12 години пред
<?php
/*Entity is a group of words which print a special symbol.
Like if we want to show copy right symbol in html page then we use &copy; code and browser convert this to actual copyright symbol.
There have lots of entity, you can find them all form http://dev.w3.org/html5/html-author/charref 
if you want to use < or > or both <> into a node value than xml will give and warning or make this value as a node.
So tell the xml parser that < or > is not tag symbol it is a entity.To do that you have to right &lt(<) and &gt;(>) instead of < and > symbol.

Entity references always begin with an ampersand (&) and end with a semicolon (;).
DO not need to use & and ; symbol begin and end of entity.Remove it when you want to use it to DOMDocument::createEntityReference
Then append to to a tag where you want to show this symbol.Like below
*/
$dom=new DOMDocument("1.0","UTF-8");
$example=$dom->createElement("example","This is copyright ");
$entity=$dom->createEntityReference("copy");
$example->appendChild($entity);
$dom->appendChild($example);
echo $dom->saveXML();

output is 
This is copyright ©
На оваа страница

Автоматски outline од активната документација.

Насловите ќе се појават тука по вчитување.

Попрегледно читање

Примерите, changelog табелите и user notes се визуелно издвоени за да не се губат во долгата содржина.

Брз совет Користи го outline-от Скокни директно на главните секции од активната страница.
Извор Оригиналниот линк останува достапен Кога ти треба целосен upstream context, отвори го PHP.net во нов tab.