htmlentitiesの読み方

htmlentitiesの読み方

phpで利用されるメソッドの1つである「htmlentities」の読み方を掲載してます。

読み⽅

エイチティーエムエル・エンティティズ」と読みます。

英訳

「entities」は「実体」という意味があります。

htmlentitiesとは

phpで、エンティティを持つ文字を全てHTMLエンティティに変換するメソッドとなります。

<?php

$str = "<a href=\"https://sebee.site/\">link</a>";

$result = htmlentities($str);

print_r($result);

実行結果

&lt;a href=&quot;https://sebee.site/&quot;&gt;link&lt;/a&gt;