For example: The string is: PO3nX+Dk+pjwOtTaFJOgoYYFqmOMO38pKA5NUkgK+gVSi+/6gVor1JfbnUvpjG9YevClBsi KjOgp9HOY6tF7Pw== I want to read 0x20 from the beginning of it, And 0x20 from the end of it. Thanks for any help!
Is this what you're looking for: <?php $string = "PO3nX+Dk+pjwOtTaFJOgoYYFqmOMO38pKA5NUkgK+gVSi+/6gVor1JfbnUvpjG9YevClBsi KjOgp9HOY6tF7Pw=="; $string_first_part = substr($string, 0, 20); $strlength = strlen($string); $strstart = $strlength - 20; $string_last_part = substr($string, $strstart, 20); // $string_first_part and $string_last_part contain first and last 20 characters of the string $string. // do with it what you want below. ?> PHP: hans
0x20 = 32, not 20 ... $string_first_part = substr($string, 0, 0x20); $string_last_part = substr($string, -0x20); ... PHP:
Thanks both of you I'm learning here .. lol I thought 0x20 just was to say 0 to 20, but had it wrong then