1

I have one array that returns one element $name, and I want to display it with another name.

For example:

$name = 'PC' and I want to display it as 'PC COMPUTER', first array displays element which is true, how to compare this elements with another array to display it with that other names?

2
  • Sorry, could you describe that a bit better? Could you show your actual code? Commented Dec 28, 2010 at 9:07
  • People can't guess exactly what you want post the both array content Commented Dec 28, 2010 at 9:08

2 Answers 2

6

Can't you just make a second array and load it up with more descriptive names, then use the first as a key?

$name = 'PC';
$description =  array('PC' => 'PC COMPUTER');
echo $descriptions[$name];

Is that what you are looking for?

Sign up to request clarification or add additional context in comments.

1 Comment

Yes, it was so easy :) Thank you
0

$array[$name] = 'PC COMPUTER' & Post ur array .give a eg:

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.