How to transform data in php
i have a variable 00 EF 5D 0E and i would want to write a function which
transforms any variable of this sort in the following manner.
1) Spaces removed and replaced with colons.
2)all letters reduced to lower case
3)if 0 is the first on a pair, it must be removed i.e
00 EF 5D 0E becomes 0:ef:5d:e
88 8E 07 TT becomes 88:8e:7:tt
Is possible to write a php function which can achieve this or i have to
extract it to a file and then use tool such as sed
No comments:
Post a Comment