Welcome to the most active Linux Forum on the web.
Go Back > Forums > Non-*NIX Forums > Programming
User Name
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.


  Search this Thread
Old 08-14-2006, 12:43 AM   #1
Registered: Apr 2004
Distribution: Linux Red Hat
Posts: 141

Rep: Reputation: 15
extracting values from an array


i have a PHP array which looks like this

$result = array (id => '1' ,
URL => ''

I have tried every bit to extract the values from the array but i have been unsuccessful.

can any one tell me how do i extract the values from the above array.

i will be using the value of the URL in a if statement.
Old 08-14-2006, 01:51 AM   #2
Senior Member
Registered: Nov 2005
Location: Hanoi
Distribution: Fedora 13, Ubuntu 10.04
Posts: 2,379

Rep: Reputation: 148Reputation: 148
$id = $result['id']
$url = $result['URL']
Old 08-14-2006, 02:07 AM   #3
Registered: Apr 2004
Distribution: Linux Red Hat
Posts: 141

Original Poster
Rep: Reputation: 15
what you suggested didnt work for me. however this did work

$ur = $URLScanQueryElementArray[0]["url"];

how can i use list() and foreach for this particular array?

here is what the array looks like

[0] => Array
[Id] => 0
[url] =>



Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
help with shell script - fill an array with values from a file delmoras Linux - General 1 07-17-2006 12:19 PM
Problem displaying Bash array values. shinobi59 Programming 3 01-17-2006 06:45 PM
rx/tx values Nauseous *BSD 1 05-26-2004 03:06 PM
How to return values into an array using awk Helene Programming 1 05-01-2004 11:05 PM
PERL: Size of an array of an Array inspleak Programming 2 03-10-2004 03:24 PM > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 05:36 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration