Hey,
So here is my prob. I want to make my own custom code formated like html code <name_here> thats easy for me... but I cannot figure out how to make it have multiple values like

<userinfo userid=19342 name=Rayn aim=Rayn>

and then have it turn those values into variables.

Thanks for your time.
- Dan

    I haven't worked much withthis, but what you should try is to find this

    /<userinfo(.*)>/i

    then you search in the result for

    /userid=([0-9]) name=([a-zA-Z]) aim=([a-zA-Z]*)/i

    (you could do this in one line)

    Then you know that in your result array the first value(0) will be the userid, the second will be the name and the third one will be the aim

    use preg for finding the values!

      Use explode(), though I don't think this is the best method, but it must be a workable one:

      e.g.

      $org = "<userinfo userid=19342 name=Rayn aim=Rayn>";

      $resultAry = explode(" ", $org);

      $useridAry = explode("=",$resultAry[1]);
      $userid = $useridAry[1];

      $nameAry = explode("=",$resultAry[2]);
      $name = $nameAry[1];

      $aimAry = explode("=",$resultAry[3]);
      $aim = $aimAry[1];

      Look silly? Yes, I think so.
      So please avoid this or use other pattern.:eek:

        Thank you very much.

        Now I have one more question.

        How would I go about taking out the < & >??

        Thanks alot

        • Dan
          EDIT : I was able to figure that out.. but now I want to make the < & >, [ & ] but when I use ereg_replace() I get a error :o

          can't you use str_replace() or string_replace() ???

            Write a Reply...