<?php
$data = '0x8000000';
$data = substr($data, 2); //remove the 0x prefix from the string
$data = str_replace(' ', '', $data); //remove the spaces from the string
//$data is now '11210031'
echo 'the product number is ' . $data[0] . "\n";
if ($data[1] == 1) {
echo "this is a new product\n";
} else if ($data[1] == 2) {
echo "this is a used product\n";
}
Warning: PHP Startup: Unable to load dynamic library 'sodium.so' (tried: /usr/lib/php/8.3.5/modules/sodium.so (libsodium.so.23: cannot open shared object file: No such file or directory), /usr/lib/php/8.3.5/modules/sodium.so.so (/usr/lib/php/8.3.5/modules/sodium.so.so: cannot open shared object file: No such file or directory)) in Unknown on line 0
the product number is 8