What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Skype & Technology » Tech Talk » [PHP] Parsing the media string

[PHP] Parsing the media string
Author: Message:
Matti
Elite Member
*****

Avatar
Script Developer and Helper

Posts: 1646
Reputation: 39
32 / Male / Flag
Joined: Apr 2004
O.P. [PHP] Parsing the media string
Ok, this simply sucks. :P

I want to parse a string like:
code:
$psm = "\\0Music\\01\\0Nu op Q: {0} - {1}\\0When It All Falls Apart\\0Veronicas\\0\\0\\0";
to an array containing its elements, like:
code:
$match = array(4) {
  [0]=> string(5)
  "Music"
  [1]=> string(18)
  "Nu op Q: {0} - {1}"
  [2]=> string(23)
  "When It All Falls Apart"
  [3]=> string(9)
  "Veronicas"
}
using preg_match(). But now I have problems with the backslash... uh?!
This code fails:
code:
preg_match("/^\\0([a-zA-Z]+)\\01\\0(.*?)\\0(.*?)\\0(.*?)\\0(.*?)\\0(.*?)\\0(.*?)$/", $psm, $ico_match);
And while I tried to look for the fault, I found that this:
code:
preg_match("/0([a-zA-Z]+)/", $psm, $ico_match);
finds "Music", while this one:
code:
preg_match("/\\0([a-zA-Z]+)/", $psm, $ico_match);
fails. :-/

Any ideas? :P
Plus! Script Developer | Plus! Beta Tester | Creator of Countdown Live | Co-developer of Screenshot Sender 5

Found my post useful? Rate me!
08-23-2006 10:05 AM
Profile E-Mail PM Web Find Quote Report
« Next Oldest Return to Top Next Newest »

Messages In This Thread
[PHP] Parsing the media string - by Matti on 08-23-2006 at 10:05 AM
RE: [PHP] Parsing the media string - by RaceProUK on 08-23-2006 at 10:59 AM
RE: [PHP] Parsing the media string - by Matti on 08-24-2006 at 07:45 AM


Threaded Mode | Linear Mode
View a Printable Version
Send this Thread to a Friend
Subscribe | Add to Favorites
Rate This Thread:

Forum Jump:

Forum Rules:
You cannot post new threads
You cannot post replies
You cannot post attachments
You can edit your posts
HTML is Off
myCode is On
Smilies are On
[img] Code is On