Skip to main content



      Home
Home » Language IDEs » PHP Development Tools (PDT) » Possible to search variables array key/value?
Possible to search variables array key/value? [message #93924] Thu, 19 February 2009 01:53 Go to next message
Eclipse UserFriend
Sometimes I need to look for specific key or value in some very large
array. Is it possible to search?
Re: Possible to search variables array key/value? [message #93957 is a reply to message #93924] Thu, 19 February 2009 04:57 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: mnm.criion.net

PHP is one of the best documented languages.

http://www.php.net/manual/en/ref.array.php
Re: Possible to search variables array key/value? [message #93971 is a reply to message #93957] Thu, 19 February 2009 05:03 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: mnm.criion.net

Search for value, reutns key:
http://www.php.net/manual/en/function.array-search.php

Search for key, returns true:
http://www.php.net/manual/en/function.array-key-exists.php
Re: Possible to search variables array key/value? [message #94294 is a reply to message #93971] Thu, 19 February 2009 23:10 Go to previous messageGo to next message
Eclipse UserFriend
Oh no. I'm sorry I didn't make it clear. I don't mean how to search
using PHP. I mean while degugging, I want to look some specific key
or value of a large array dispalyed in debugger's variable view.

On Thu, 19 Feb 2009 11:03:09 +0100, "Michael N. Madsen"
<mnm@criion.net> wrote:

>Search for value, reutns key:
>http://www.php.net/manual/en/function.array-search.php
>
>Search for key, returns true:
>http://www.php.net/manual/en/function.array-key-exists.php
Re: Possible to search variables array key/value? [message #94303 is a reply to message #94294] Fri, 20 February 2009 03:48 Go to previous messageGo to next message
Eclipse UserFriend
If you are using xdebug you need to expand all the elements in the variables view of the array, then
you can RMB to get the popup menu and select find.

You need to expand the array to request the data from xdebug. The whole array information including
the keys are not downloaded in one large chunk, but requested when you expand the elements so it
would not be possible to search for the information until all the keys are retrieved from xdebug.

Alternatively if you know the key value, you can create a watch expression to display just that value.

Dave Kelsey

Matthew Young wrote:
> Oh no. I'm sorry I didn't make it clear. I don't mean how to search
> using PHP. I mean while degugging, I want to look some specific key
> or value of a large array dispalyed in debugger's variable view.
>
> On Thu, 19 Feb 2009 11:03:09 +0100, "Michael N. Madsen"
> <mnm@criion.net> wrote:
>
>> Search for value, reutns key:
>> http://www.php.net/manual/en/function.array-search.php
>>
>> Search for key, returns true:
>> http://www.php.net/manual/en/function.array-key-exists.php
Re: Possible to search variables array key/value? [message #94351 is a reply to message #94294] Fri, 20 February 2009 16:16 Go to previous messageGo to next message
Eclipse UserFriend
Matthew,

To expand on Dave's comment towards the end of his post. Watch
Expressions are a very powerful part of debugging. Unfortunately when
you first go into PHP Debugging mode that view is not present. If you go
to the menu for Window -> Show View -> Expressions you will get a new
tab available. Within this view you can create expressions that you want
to evaluate wherever you are in your code. You could then setup an
expression to do an array search for the key / value you want and as you
step through the code the expression would continue to be re-evaluated.
It provides a lot of power over the Variables view as that is just a
full dump of all the variables.

--
Shawn Clark

Matthew Young wrote:
> Oh no. I'm sorry I didn't make it clear. I don't mean how to search
> using PHP. I mean while degugging, I want to look some specific key
> or value of a large array dispalyed in debugger's variable view.
>
> On Thu, 19 Feb 2009 11:03:09 +0100, "Michael N. Madsen"
> <mnm@criion.net> wrote:
>
>> Search for value, reutns key:
>> http://www.php.net/manual/en/function.array-search.php
>>
>> Search for key, returns true:
>> http://www.php.net/manual/en/function.array-key-exists.php
Re: Possible to search variables array key/value? [message #94364 is a reply to message #94351] Sat, 21 February 2009 02:03 Go to previous message
Eclipse UserFriend
This is awesome! Thank you.
Previous Topic:Template Contexts
Next Topic:No autocompletion - even with simple code
Goto Forum:
  


Current Time: Thu Mar 27 00:52:47 EDT 2025

Powered by FUDForum. Page generated in 0.03573 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top