[lang-ref] ( char_to_charcode ) ( php )

<?php
public function testCharToCharcode(): void
{
	// mb_ord
	$this->assertSame(97, mb_ord('a', 'UTF-8'));
}
<?php
public function testCharToCharcodeAlternative(): void
{
	// only first character is converted, and not throws
	$this->assertSame(97, mb_ord('ab', 'UTF-8'));
}