map200uk Posted May 16, 2007 Share Posted May 16, 2007 ive got 1/2 of what i was trying sorted out however i now need to get rid of some of the junk, i ned to strip the ?? (chr(0) and also the = sign and obviously the tag name i was thinking of an array containing the field names i.e. Artist loop through the array and compare it with the variable, if it is there use str_replace and cut it out? and same with the = and chr(0) i was wondering tho is there any way i can do it without needing a number of different statements [code]Xiph.Org libVorbis I 20020717 7 there are 7 frames present first comment is 11 bytes long First comment has the value => ���Album=avvvv12 2nd value is => 12 bytes Second comment has the value => ���Artist=avril Third comment has the value => ���Comment=aaa Fourth comment has the value ���Genre=Alt. Rock Fith comment has value => ���Title=girlfriend Sixth comment has the value => ���Tracknumber=2 [/code] Link to comment https://forums.phpfreaks.com/topic/51720-cutting-parts-of-a-string/ Share on other sites More sharing options...
effigy Posted May 16, 2007 Share Posted May 16, 2007 <pre> <?php echo $test = chr(0) . chr(0) . 'Artist=They Might Be Giants'; echo '<br>'; echo preg_replace('/^\x0+[^=]+=/', '', $test); ?> </pre> Link to comment https://forums.phpfreaks.com/topic/51720-cutting-parts-of-a-string/#findComment-254817 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.