What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Skype & Technology » Tech Talk » [PHP] Regular expressions and Status2FTP

[PHP] Regular expressions and Status2FTP
Author: Message:
Matti
Elite Member
*****

Avatar
Script Developer and Helper

Posts: 1646
Reputation: 39
32 / Male / Flag
Joined: Apr 2004
O.P. [PHP] Regular expressions and Status2FTP
Yes, me again. :P

I just downloaded and installed Status2FTP, and I immediatly fell in love with it. :) It does what it has to do, and now I want to use it in my signature, as replacement for Web2Messenger.

This means that I have to replace this:
code:
<Details>
<Username>[c=1]<simply[b]_me>[/b][/c=12]</Username>
<PSM><:o) Messenger Plus! [c=7]Live[/c] is arrived! <:o)</PSM>
<Status>Online</Status>
</Details>
into this:
code:
$nick = "[c=1]<simply[b]_me>[/b][/c=12]";
$psm = "<:o) Messenger Plus! [c=7]Live[/c] is arrived! <:o)";
$status = "Online";
So far, I managed to create a function called getXMLData($i) to return the value for $nick, $psm and $status:
code:
function getXMLData($i) {
global $content2;
$data = str_replace(array("<Details>","</Details>"), "", $content2);
$data0 = preg_replace("/<Username>(.*?)<\/Username>/","\\1", $data);
$data1 = preg_replace("/<PSM>(.*?)<\/PSM>/","\\1", $data);
$data2 = preg_replace("/<Status>(.*?)<\/Status>/","\\1", $data);
eval("return \$data$i;");
}
$content2 is the variable containing the XML file, but unfortunaly it doesn't works like I wanted. As you can see, it only drops the <Username> and </Username> tags, where it has to drop these tags and everything before and behind it. And with my small knowledge of regular expressions, I'm back to ask the Messenger Plus! Live community. :)

Any replies or questions are more than welcome! ;)

This post was edited on 06-25-2006 at 08:18 AM by Matti.
Plus! Script Developer | Plus! Beta Tester | Creator of Countdown Live | Co-developer of Screenshot Sender 5

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

Messages In This Thread
[PHP] Regular expressions and Status2FTP - by Matti on 06-25-2006 at 08:17 AM
RE: [PHP] Regular expressions and Status2FTP - by Matti on 06-25-2006 at 08:25 AM
RE: [PHP] Regular expressions and Status2FTP - by Eljay on 06-25-2006 at 08:28 AM
RE: [PHP] Regular expressions and Status2FTP - by -dt- on 06-25-2006 at 08:29 AM
RE: [PHP] Regular expressions and Status2FTP - by Matti on 06-25-2006 at 09:16 AM
RE: [PHP] Regular expressions and Status2FTP - by Death.Knight on 11-06-2006 at 04:09 AM
RE: [PHP] Regular expressions and Status2FTP - by NiteMare on 11-06-2006 at 04:39 AM
RE: [PHP] Regular expressions and Status2FTP - by Eljay on 11-06-2006 at 05:30 PM
RE: [PHP] Regular expressions and Status2FTP - by NiteMare on 11-06-2006 at 05:32 PM
RE: [PHP] Regular expressions and Status2FTP - by Eljay on 11-06-2006 at 05:36 PM


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