Jump to content

Search the Community

Showing results for tags 'irc parsing'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • Welcome to PHP Freaks
    • Announcements
    • Introductions
  • PHP Coding
    • PHP Coding Help
    • Regex Help
    • Third Party Scripts
    • FAQ/Code Snippet Repository
  • SQL / Database
    • MySQL Help
    • PostgreSQL
    • Microsoft SQL - MSSQL
    • Other RDBMS and SQL dialects
  • Client Side
    • HTML Help
    • CSS Help
    • Javascript Help
    • Other
  • Applications and Frameworks
    • Applications
    • Frameworks
    • Other Libraries
  • Web Server Administration
    • PHP Installation and Configuration
    • Linux
    • Apache HTTP Server
    • Microsoft IIS
    • Other Web Server Software
  • Other
    • Application Design
    • Other Programming Languages
    • Editor Help (PhpStorm, VS Code, etc)
    • Website Critique
    • Beta Test Your Stuff!
  • Freelance, Contracts, Employment, etc.
    • Services Offered
    • Job Offerings
  • General Discussion
    • PHPFreaks.com Website Feedback
    • Miscellaneous

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


AIM


MSN


Website URL


ICQ


Yahoo


Jabber


Skype


Location


Interests


Age


Donation Link

Found 1 result

  1. Hello! I made a function to split an IRC message into its: prefix, command, arguments and trailing data. It works, mostly, except if I add a string that I'm exploding into the trailing data, it will attempt to explode that, instead of the first instance. Like this: public function parse_message($str) { $array = explode(' ', $str); $username = substr($array[0], 1); $username = explode('!', $username); $username = isset($username[0]) ? $username[0] : ''; $command = isset($array[1]) ? $array[1] : ''; $args = ''; $count = count($array); for($i = 2; $i < $count; $i++) $args .= $array[$i] . ' '; $args = explode(' :', $args); $trailing = isset($args[1]) ? $args[1] : ''; $args = isset($args[0]) ? $args[0] : ''; //:orpheus!1844a5bd@23n.np3.hq2haj.IP PRIVMSG #balls :wah return array('username' => $username, 'command' => $command, 'args' => $args, 'trail' => $trailing); } //:orpheus!1844a5bd@23n.np3.hq2haj.IP PRIVMSG #balls :!eval $this->chat("QUIT :Goodbye."); //"QUIT :Goodbye" makes it only split up to there. It should get everything after #balls :, which it does, but if I add an extra " :", it will only get the first index of the array. Also, if someone could maybe find a better way to do this, that'd be great
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.