There're free and paid tools for encode your php script. Personally I like Byterun Online Free PHP Encoder for a small job, it's an online tool and cost nothing but if you're in a big project you may looking for other tools.
What will happenned to PHP scripts after encoded
echo "Hello World";
As you see PHP code after encoded, you don't understand it, but this code still executable and the result is the same as result before encode.
Here is the list of tools