Created
January 26, 2018 16:03
-
-
Save castrolol/77d0fa303359684b86a264dfe4a6a3c0 to your computer and use it in GitHub Desktop.
Regex RFID
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$matches = []; | |
$rfid = "EPC: e2003532b5071f30b520687c RSSI: -58 PC: 3000 CRC: 808C TID: # 0"; | |
preg_match("/^([0-9A-Z]+) *: +(?P<codigo>[a-zA-Z0-9]+)/", $rfid, $matches, PREG_OFFSET_CAPTURE); | |
echo "<pre>"; | |
var_dump($matches["codigo"][0]); | |
echo "</pre>"; | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment