What is the significance of using the ord() function in converting a string to a double in PHP?

When converting a string to a double in PHP, the ord() function can be used to get the ASCII value of the first character in the string. This ASCII value can then be used as the numerical representation of the character, which can be converted to a double. This method is useful when dealing with strings that contain numerical values represented as characters, such as "1", "2", "3", etc.

$string = "123.45";
$first_char = substr($string, 0, 1);
$ascii_value = ord($first_char);
$double_value = (double) $ascii_value;

echo $double_value; // Output: 49