Php Binary to Base64

<?php
$str = 'I am some string';
echo base64_encode($str);
Ahmed