is it possible to convert a string to varbinary in PHP without using the SQL function
you can cast a string as a binary if you are using a recent enough version of PHP.
$binary = (binary)$string;
(binary) casting and b prefix forward support was added in PHP 5.2.1
http://www.php.net/manual/en/language.types.type-juggling.php
public static function str2bin($str) { return '0x'.strtoupper(bin2hex($str));}
You can also use the pack function
exampleconvert {326546, 4356345, 43646346, 366357547} to var-binary as Unsigned int
$_BIN=pack('I*', 326546, 4356345, 43646346, 366357547);
you can find more examples at http://www.php.net/manual/en/function.pack.php