Search in a array

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Search in a array

    i got a bug i need fixing

    Here a lay

    PHP Code:
    $code = array("P0001"=>" Fuel Volume Regulator Control Circuit/Open ","
    P0002"
    =>" Fuel Volume Regulator Control Circuit Range/Performance ",
    P0003"
    =>" Fuel Volume Regulator Control Circuit Low ","
    P0004"
    =>" Fuel Volume Regulator Control Circuit High"); 
    Trying to search 1 line

    P0002 and it will show you

    P0002 - Fuel Volume Regulator Control Circuit Range/Performance
    Visit: Chat4u.mobi - The New Lay Of being a site of your dreams!
    Visit: WapMasterz Coming Back Soon!
    _______
    SCRIPTS FOR SALE BY SUBZERO
    Chat4u Script : coding-talk.com/f28/chat4u-mobi-script-only-150-a-17677/ - > Best Script for your site no other can be hacked by sql or uploaders.
    FileShare Script : coding-talk.com/f28/file-wap-share-6596/ -> Uploader you will never regret buying yeah it mite be old now but it still seems to own others...
    _______
    Info & Tips
    php.net
    w3schools.com

    #2
    There is an extra space in the keys of your array

    PHP Code:
    <?
    $code = array("P0001" => " Fuel Volume Regulator Control Circuit/Open ", 
    "P0002" => " Fuel Volume Regulator Control Circuit Range/Performance ", 
    "P0003" => " Fuel Volume Regulator Control Circuit Low ", 
    "P0004" => " Fuel Volume Regulator Control Circuit High");
    echo $code['P0002'];
    Added after 5 minutes:

    print_r() result
    Before

    Code:
    Array
    (
        [P0001] =>  Fuel Volume Regulator Control Circuit/Open 
        [ 
    P0002] =>  Fuel Volume Regulator Control Circuit Range/Performance 
        [  
    P0003] =>  Fuel Volume Regulator Control Circuit Low 
        [ 
    P0004] =>  Fuel Volume Regulator Control Circuit High
    )
    After removing the spaces

    Code:
    Array
    (
        [P0001] =>  Fuel Volume Regulator Control Circuit/Open 
        [P0002] =>  Fuel Volume Regulator Control Circuit Range/Performance 
        [P0003] =>  Fuel Volume Regulator Control Circuit Low 
        [P0004] =>  Fuel Volume Regulator Control Circuit High
    )
    Last edited by softwarefreak; 16.10.12, 14:27.
    I need some facebook likes, can you please help me
    http://facebook.com/softwarefreakin
    I noticed social media is really powerful
    Well DONE is better than well SAID

    Comment


      #3
      the list is 36 kb its self
      Visit: Chat4u.mobi - The New Lay Of being a site of your dreams!
      Visit: WapMasterz Coming Back Soon!
      _______
      SCRIPTS FOR SALE BY SUBZERO
      Chat4u Script : coding-talk.com/f28/chat4u-mobi-script-only-150-a-17677/ - > Best Script for your site no other can be hacked by sql or uploaders.
      FileShare Script : coding-talk.com/f28/file-wap-share-6596/ -> Uploader you will never regret buying yeah it mite be old now but it still seems to own others...
      _______
      Info & Tips
      php.net
      w3schools.com

      Comment


        #4
        Originally posted by subzero View Post
        the list is 36 kb its self
        Then just use
        PHP Code:
        $val array_values($code);
        $key array_keys($code);
        echo 
        $key[1] . " - " $val[1]; 
        I need some facebook likes, can you please help me
        http://facebook.com/softwarefreakin
        I noticed social media is really powerful
        Well DONE is better than well SAID

        Comment


          #5
          Its picking it all up now thanks bro

          Added after 55 minutes:

          Here a demo On Board Diagnostics - Car Error Codes
          Last edited by subzero; 16.10.12, 16:00.
          Visit: Chat4u.mobi - The New Lay Of being a site of your dreams!
          Visit: WapMasterz Coming Back Soon!
          _______
          SCRIPTS FOR SALE BY SUBZERO
          Chat4u Script : coding-talk.com/f28/chat4u-mobi-script-only-150-a-17677/ - > Best Script for your site no other can be hacked by sql or uploaders.
          FileShare Script : coding-talk.com/f28/file-wap-share-6596/ -> Uploader you will never regret buying yeah it mite be old now but it still seems to own others...
          _______
          Info & Tips
          php.net
          w3schools.com

          Comment


            #6
            The demo is cool bro, its nice that how some simple php codes can make such useful sfuffs! :D
            I need some facebook likes, can you please help me
            http://facebook.com/softwarefreakin
            I noticed social media is really powerful
            Well DONE is better than well SAID

            Comment


              #7
              Yeah, it taken me mostly all night getting all the P codes lmao
              Visit: Chat4u.mobi - The New Lay Of being a site of your dreams!
              Visit: WapMasterz Coming Back Soon!
              _______
              SCRIPTS FOR SALE BY SUBZERO
              Chat4u Script : coding-talk.com/f28/chat4u-mobi-script-only-150-a-17677/ - > Best Script for your site no other can be hacked by sql or uploaders.
              FileShare Script : coding-talk.com/f28/file-wap-share-6596/ -> Uploader you will never regret buying yeah it mite be old now but it still seems to own others...
              _______
              Info & Tips
              php.net
              w3schools.com

              Comment

              Working...
              X