Search in a array

Started on the old forum in October 2012 · view the original in the archive · old links redirect here

6 replies · 505 views · started 14 years ago · 1 min read

2 participants
subzero Super moderator Fellow · 3,954 posts #1

i got a bug i need fixing

Here a lay

$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... _______…

softwarefreak Senior · 349 posts #2

There is an extra space in the keys of your array

<?
$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

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

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
)

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

subzero Super moderator Fellow · 3,954 posts #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... _______…

softwarefreak Senior · 349 posts #4

subzero wrote: the list is 36 kb its self

Then just use

$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

subzero Super moderator Fellow · 3,954 posts #5

Its picking it all up now thanks bro

Added after 55 minutes:

Here a demo On Board Diagnostics - Car Error Codes

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... _______…

softwarefreak Senior · 349 posts #6

The demo is cool bro, its nice that how some simple php codes can make such useful sfuffs! 😀

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

subzero Super moderator Fellow · 3,954 posts #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... _______…

Sign in to reply.

Similar topics

Keyboard shortcuts

g f
Go to forums
g h
Go to your feed
g m
Go to messages
r
Reply (in a topic)
/
Search
j
Next post
k
Previous post
?
This list
Ctrl/⌘ + Enter
Send what you are writing
Ctrl/⌘ + B / I
Bold / italic while writing
Esc
Close