Convert String to Base64 in PHP June 1, 2022June 1, 2022 <?php $str = 'nilpointer.net'; $result = base64_encode($str); echo $result; ?> Output bmlscG9pbnRlci5uZXQ=