I had fun for this for a while. Then I cam across another similar topic and someone mentioned using PortMon to view the output to the serial port. In the log was a reference to 7 character encoding which appears to be the default for the php_serial.class library. The simple approach is to add:
$serial->confCharacterLength(

;
to your php script so it becomes:
<?php
require("php_serial.class.php"); //the one widely available on the Net
function writeToArduino($str){
$serial = new phpSerial();
$serial->deviceSet("COM2");
$serial->confBaudRate(9600);
$serial->confCharacterLength(

;
$serial->deviceOpen();
for ($i=0; $i<strlen($str); $i++){
$serial->sendMessage($str[$i]);
}
$serial->deviceClose();
}
$tmptext = "12345ABCDE";
writeToArduino($tmptext);
?>