Skip to main content
Commonmark migration
Source Link

#PHP, 119 bytes

PHP, 119 bytes

foreach(explode(B,$argn)as$i=>$m)($v=$v*16+4*strpos(XIAO,$m[-3]?:B)+strpos(IAOU,$m[-1]?:B))?$i&1||print chr($v&=255):0;

assumes uppercase input. Run as pipe with -nR or try it online.

requires PHP 7.1
for older PHP, use substr($m,-3,1) and substr($m,-1) instead of $m[-<x>] (+16 bytes);
for younger PHP, put B, XIAO and IAOU in quotes to avoid warning messages (+10 bytes).

#PHP, 119 bytes

foreach(explode(B,$argn)as$i=>$m)($v=$v*16+4*strpos(XIAO,$m[-3]?:B)+strpos(IAOU,$m[-1]?:B))?$i&1||print chr($v&=255):0;

assumes uppercase input. Run as pipe with -nR or try it online.

requires PHP 7.1
for older PHP, use substr($m,-3,1) and substr($m,-1) instead of $m[-<x>] (+16 bytes);
for younger PHP, put B, XIAO and IAOU in quotes to avoid warning messages (+10 bytes).

PHP, 119 bytes

foreach(explode(B,$argn)as$i=>$m)($v=$v*16+4*strpos(XIAO,$m[-3]?:B)+strpos(IAOU,$m[-1]?:B))?$i&1||print chr($v&=255):0;

assumes uppercase input. Run as pipe with -nR or try it online.

requires PHP 7.1
for older PHP, use substr($m,-3,1) and substr($m,-1) instead of $m[-<x>] (+16 bytes);
for younger PHP, put B, XIAO and IAOU in quotes to avoid warning messages (+10 bytes).

added PHP version hints
Source Link
Titus
  • 14.8k
  • 1
  • 24
  • 41

#PHP, 119 bytes

foreach(explode(B,$argn)as$i=>$m)($v=$v*16+4*strpos(XIAO,$m[-3]?:XB)+strpos(IAOU,$m[-1]?:XB))?$i&1||print chr($v&=255):0;

requiresassumes uppercase input. Run as pipe with -nR or try it online.

requires PHP 7.1
for older PHP, use substr($m,-3,1) and substr($m,-1) instead of $m[-<x>] (+16 bytes);
for younger PHP, put B, XIAO and IAOU in quotes to avoid warning messages (+10 bytes).

#PHP, 119 bytes

foreach(explode(B,$argn)as$i=>$m)($v=$v*16+4*strpos(XIAO,$m[-3]?:X)+strpos(IAOU,$m[-1]?:X))?$i&1||print chr($v&=255):0;

requires uppercase input. Run as pipe with -nR or try it online.

#PHP, 119 bytes

foreach(explode(B,$argn)as$i=>$m)($v=$v*16+4*strpos(XIAO,$m[-3]?:B)+strpos(IAOU,$m[-1]?:B))?$i&1||print chr($v&=255):0;

assumes uppercase input. Run as pipe with -nR or try it online.

requires PHP 7.1
for older PHP, use substr($m,-3,1) and substr($m,-1) instead of $m[-<x>] (+16 bytes);
for younger PHP, put B, XIAO and IAOU in quotes to avoid warning messages (+10 bytes).

Source Link
Titus
  • 14.8k
  • 1
  • 24
  • 41

#PHP, 119 bytes

foreach(explode(B,$argn)as$i=>$m)($v=$v*16+4*strpos(XIAO,$m[-3]?:X)+strpos(IAOU,$m[-1]?:X))?$i&1||print chr($v&=255):0;

requires uppercase input. Run as pipe with -nR or try it online.