Hello
I have a string which I read from a file
I would like to test if the string begins with a specific hex prefix like so:
FF D8 FF E0
the value read from the file is found in a variable called $input
How can I make such comparison?
regards
comparing hex values comprising string
Moderator: General Moderators
- n00b Saibot
- DevNet Resident
- Posts: 1452
- Joined: Fri Dec 24, 2004 2:59 am
- Location: Lucknow, UP, India
- Contact:
Code: Select all
if (preg_match("e;#^FF D8 FF E0#"e;,$input))
//then do whatever-
R0d Longfella
- Forum Newbie
- Posts: 20
- Joined: Fri Apr 08, 2005 7:17 am