I need php help

Discussion in 'PHP' started by mudassarahmad, Dec 1, 2007.

  1. #1
    This is string store in database.
    $sentence = "UserName=qaidoshkosh|| Majlis=willingboro|| Submit=Submit||";

    I want to output of string just like that.

    $sentence = "qaidoshkosh willingboro Submit";
     
    mudassarahmad, Dec 1, 2007 IP
  2. live-cms_com

    live-cms_com Notable Member

    Messages:
    3,128
    Likes Received:
    112
    Best Answers:
    0
    Trophy Points:
    205
    Digital Goods:
    1
    #2
    Your developer is not very good. That should have been in a table with column names UserName, Majlis and Submit.

    To output that as it is you would use -

    $var = explode("|| ", $sentence);
    for($x = 1; x <= 3; x++){
    $var2 = explode("=", $var[$x]);
    echo $var2[1];
    }

    Although that was off the top of my head so could be wrong.
     
    live-cms_com, Dec 1, 2007 IP
  3. mudassarahmad

    mudassarahmad Peon

    Messages:
    12
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    $sentence = "UserName=qaidoshkosh|| Majlis=willingboro|| Region=east||";
    $var = explode("|| ", $sentence);
    for($x = 0; $x <= 3; $x++)
    {
    $var2 = explode("=", $var[$x]);
    echo $var2[1];
    }
     
    mudassarahmad, Dec 1, 2007 IP