str_pad() can provide sufficient "zero padding" when using block ciphers and manual padding with openssl_encrypt() and similar.
The example below will pad the 6 character text "Secret" with two \x00 characters and return 8 characters of data. Substitute your plain text and block size as needed.
<?php
$text = "Secret";
$block_size = 8;
$length = ceil(strlen($text) / $block_size) * $block_size;
$data = str_pad($text, $length, "\x00");