Re: [PHP] Re: Array Search - Solved

2011-03-26 Thread Ethan Rosenberg
At 01:31 PM 3/25/2011, João Cândido de Souza Neto wrote: It´s a job to array_key_exists function. -- João Cândido de Souza Neto "Ethan Rosenberg" escreveu na mensagem news:0lim00hi3ihny...@mta4.srv.hcvlny.cv.net... > Dear List - > > Here is a code snippet: > > $bla = array("g1" => $r

[PHP] Re: Array Search

2011-03-25 Thread Jo�o C�ndido de Souza Neto
It´s a job to array_key_exists function. -- João Cândido de Souza Neto "Ethan Rosenberg" escreveu na mensagem news:0lim00hi3ihny...@mta4.srv.hcvlny.cv.net... > Dear List - > > Here is a code snippet: > > $bla = array("g1" => $results[7][6], >"h1" => $results[7][7]); >

Re: [PHP] Re: array to var - with different name

2011-01-21 Thread Shawn McKenzie
On 01/20/2011 05:26 PM, Tommy Pham wrote: > On Thu, Jan 20, 2011 at 2:49 PM, Shawn McKenzie wrote: >> On 01/20/2011 04:28 PM, Donovan Brooke wrote: >>> Hello again! >>> >>> I'm trying to find a good way to convert array key/value's to >>> variable name values... but with the caveat of the name b

Re: [PHP] Re: array to var - with different name

2011-01-20 Thread Tommy Pham
On Thu, Jan 20, 2011 at 2:49 PM, Shawn McKenzie wrote: > On 01/20/2011 04:28 PM, Donovan Brooke wrote: >> Hello again! >> >> I'm trying to find a good way to convert array key/value's to >> variable name values... but with the caveat of the name being >> slightly different than the original key >>

[PHP] Re: array to var - with different name

2011-01-20 Thread Shawn McKenzie
On 01/20/2011 04:28 PM, Donovan Brooke wrote: > Hello again! > > I'm trying to find a good way to convert array key/value's to > variable name values... but with the caveat of the name being > slightly different than the original key > (to fit my naming conventions). > > first, I (tediously) did

[PHP] Re: Array question

2010-09-27 Thread Erik L. Arneson
pgpSkuPbKbfsy.pgp Description: PGP signature

Re: [PHP] Re: array or list of objects of different types

2010-04-03 Thread Peter Pei
var_dump( array( true , 12 , "php already does this" ) ); array(3) { [0]=> bool(true) [1]=> int(12) [2]=> string(21) "php already does this" } :) Yeah. But this feature of PHP is a boon if used carefully and a curse if careless. You can get AMAZING results if you're not caref

Re: [PHP] Re: array or list of objects of different types

2010-04-02 Thread Nilesh Govindarajan
On 04/03/10 05:42, Nathan Rixham wrote: Php Developer wrote: Hi all, I want to be able to have an array of elements of different types. As an example: the first element is a boolean, the second is an integer, and the thirs is a string. In php there is no typing, i'm just wondering if there i

[PHP] Re: array or list of objects of different types

2010-04-02 Thread Nathan Rixham
Php Developer wrote: > Hi all, > > I want to be able to have an array of elements of different types. As an > example: the first element is a boolean, the second is an integer, and the > thirs is a string. > > In php there is no typing, i'm just wondering if there is a way to have that, > it w

[PHP] Re: Array Search Not Working?

2010-03-10 Thread clancy_1
On Wed, 10 Mar 2010 09:52:30 -0500, aj...@alumni.iu.edu (Alice Wei) wrote: > >Hi, > > I have two arrays here that I have combined into a new array, as shown here: > >$from = explode("-", $from); >$change = explode("-",$change); >$new_array = array_combine($from,$change); > >I then tried reading i

[PHP] RE: Array Search Not Working?

2010-03-10 Thread Alice Wei
> > I'm still a little foggy on what you're doing, but doing, but does this > help? > > $from = explode("-", $from); > $state_colors = explode("-", $state_colors); > $change = explode("-", $change); > > $old = array_combine($from, $state_colors); > $new = array_combine($from, $change); > > //s

[PHP] Re: Array Search Not Working?

2010-03-10 Thread Shawn McKenzie
Alice Wei wrote: > From: aj...@alumni.iu.edu > To: nos...@mckenzies.net > CC: php-general@lists.php.net > Subject: RE: Array Search Not Working? > Date: Wed, 10 Mar 2010 11:21:26 -0500 I'm still a little foggy on what you're doing, but doing, but does this help? $from = explode("-", $from); $stat

[PHP] RE: Array Search Not Working?

2010-03-10 Thread Alice Wei
From: aj...@alumni.iu.edu To: nos...@mckenzies.net CC: php-general@lists.php.net Subject: RE: Array Search Not Working? Date: Wed, 10 Mar 2010 11:21:26 -0500 > Date: Wed, 10 Mar 2010 10:09:54 -0600 > From: nos...@mckenzies.net > To: aj...@alumni.iu.edu > CC: php-general@lists.php.net > Sub

[PHP] RE: Array Search Not Working?

2010-03-10 Thread Alice Wei
> Date: Wed, 10 Mar 2010 10:09:54 -0600 > From: nos...@mckenzies.net > To: aj...@alumni.iu.edu > CC: php-general@lists.php.net > Subject: Re: Array Search Not Working? > > Alice Wei wrote: > > Hi, > > > > I have two arrays here that I have combined into a new array, as shown > > here: > > >

[PHP] Re: Array Search Not Working?

2010-03-10 Thread Shawn McKenzie
Alice Wei wrote: > Hi, > > I have two arrays here that I have combined into a new array, as shown here: > > $from = explode("-", $from); > $change = explode("-",$change); > $new_array = array_combine($from,$change); > > I then tried reading it from a file and do string matches, trying to find

Re: [PHP] Re: Array

2009-08-10 Thread Jim Lucas
Robert Cummings wrote: > Colin Guthrie wrote: >> 'Twas brillig, and Jim Lucas at 10/08/09 16:29 did gyre and gimble: >>> $d = array( >>> "home_page", >>> "member_services", >>> "member_services_login", >>> "network", >>> "resource_center", >>> "verse_of_the_day_activate", >>

Re: [PHP] Re: Array

2009-08-10 Thread Robert Cummings
Colin Guthrie wrote: 'Twas brillig, and Jim Lucas at 10/08/09 16:29 did gyre and gimble: $d = array( "home_page", "member_services", "member_services_login", "network", "resource_center", "verse_of_the_day_activate", ); Ahh someone else who alway

[PHP] Re: Array

2009-08-10 Thread Colin Guthrie
'Twas brillig, and Jim Lucas at 10/08/09 16:29 did gyre and gimble: $d = array( "home_page", "member_services", "member_services_login", "network", "resource_center", "verse_of_the_day_activate", ); Ahh someone else who always puts a closing , on

[PHP] Re: Array Brain Freeze

2009-03-19 Thread Dan Shirah
> > Hello all, > > I have the follwoing piece of code: > > //reference a stored procedure > $procedure = "Execute Procedure informix.arrest_char($part_id)"; > > //run the stored procedure > $char_query = ifx_query($procedure, $connect_id); > > //get the result of the stored procedure > $char_result

Re: [PHP] Re: array recursion from database rows

2008-05-25 Thread Larry Garfield
On Saturday 24 May 2008, Chris W wrote: > Bob wrote: > > Hi. > > > > I have a database table I have created for navigation. > > > > The table fields are uid, parent_id, menu_name. > > > > Each entry is either a top level element with a parent_id of 0 or a child > > which has a parent_id that relate

[PHP] Re: array recursion from database rows

2008-05-24 Thread Chris W
Bob wrote: Hi. I have a database table I have created for navigation. The table fields are uid, parent_id, menu_name. Each entry is either a top level element with a parent_id of 0 or a child which has a parent_id that relates to the parent uid. What I am trying to do is recurse through a set

[PHP] Re: Array to Object

2007-02-13 Thread Daniel Kullik
Eli wrote: Hi, Having this array: $arr = array( 'my var'=>'My Value' ); Notice the space in 'my var'. Converted to object: $obj = (object)$arr; How can I access $arr['my var'] in $obj ? -thanks! print $obj->{'my var'}; $obj->{'my var'} = 'My New Value'; print $obj->{'my var'};

[PHP] Re: Array decleration problem

2007-01-03 Thread Al
There another error in your code in addition to the missing ";", echo() is for strings, not arrays. Also, look up the use of single and double quotes in the php docs. It's a good habit to learn to use the right one early on. Delta Storm wrote: Hi, I'm new to php and im learning, I haven't e

[PHP] Re: Array decleration problem

2007-01-03 Thread Jo�o C�ndido de Souza Neto
it happens because you forgot the semi-collon at the end of the previews line. "Delta Storm" <[EMAIL PROTECTED]> escreveu na mensagem news:[EMAIL PROTECTED] > Hi, > > I'm new to php and im learning, I haven't encounter any problems till now > so please help me? :) > > the code: (learning arrays

[PHP] Re: Array Question again

2006-03-29 Thread Barry
cybermalandro cybermalandro wrote: Let me try this again. I want to take an array that may look like this Opening new Threads over and over don't do any good. Please stick to your opened thread about that issue please. Greets Barry -- Smileys rule (cX.x)C --o(^_^o) Dance for me! ^(^_

[PHP] Re: Array Question

2006-03-29 Thread cybermalandro cybermalandro
Well I don't want have to specify $val['ponbr'] == 'TEST1' I want to say if ($val['ponbr'] == repeated value) then $resultArray[$key] = $val; In other words I want to go through the array matched the values of ponbr that repeat or are the same so if they match then I put the results in another arr

[PHP] Re: Array Question

2006-03-29 Thread M. Sokolewicz
cybermalandro cybermalandro wrote: So, I have an array that looks like this rray(3) { [0]=> array(8) { ["line"]=> string(1) "1" ["ponbr"]=> string(5) "34474" ["emt"]=> string(3) "yes" ["qty"]=> string(1) "5" ["price"]=> string(2) "19" ["shipdate"

[PHP] Re: array variables with or without quotes

2006-02-22 Thread 2dogs
Chuck, you are the man! I decided to reread the manual word for word but have only gotten through Strings as of last night. Thanks for zeroing me in on the right spot. txs 2dogs "Chuck Anderson" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > 2dogs wrote: > >>I recently encou

RE: [PHP] Re: array variables with or without quotes

2006-02-22 Thread Jason Karns
like a key. If it is found as a constant, then the constant's value is used as the key. Jason -Original Message- From: Chuck Anderson [mailto:[EMAIL PROTECTED] Sent: Wednesday, February 22, 2006 3:30 PM To: php-general@lists.php.net Subject: [PHP] Re: array variables with or with

[PHP] Re: array variables with or without quotes

2006-02-22 Thread Chuck Anderson
2dogs wrote: I recently encountered a situation where I had to retrieve data from a MYSQL database table with a field named "include". My code looked like this: $content_result = mysql_query('SELECT * FROM calander') or die(mysql_error()); $content_row = mysql_fetch_array($content_result); i

Re: [PHP] Re: Array sizes?

2006-02-08 Thread Anders Norrbring
Rory Browne skrev: At 01:05 AM 2/8/2006, Barry wrote: I don't think a "function" exists, but i would probably use (for benchmarking) a recursive foreach in combination with strlen. And add it all up. (This is probably some work for the PC so that's why benchmarking) It would be interesting to

Re: [PHP] Re: Array sizes?

2006-02-08 Thread Rory Browne
> At 01:05 AM 2/8/2006, Barry wrote: > >I don't think a "function" exists, but i would probably use (for > >benchmarking) a recursive foreach in combination with strlen. > >And add it all up. > >(This is probably some work for the PC so that's why benchmarking) > > > It would be interesting to know

Re: [PHP] Re: Array sizes?

2006-02-08 Thread Barry
Paul Novitski wrote: Anders Norrbring wrote: Maybe I'm just blind, but I can't find any way to count an array size in bytes? I have a quite big array with multiple data formats in it, and I would like to know how big it is in bytes... At 01:05 AM 2/8/2006, Barry wrote: I don't think a "fu

Re: [PHP] Re: Array sizes?

2006-02-08 Thread Paul Novitski
Anders Norrbring wrote: Maybe I'm just blind, but I can't find any way to count an array size in bytes? I have a quite big array with multiple data formats in it, and I would like to know how big it is in bytes... At 01:05 AM 2/8/2006, Barry wrote: I don't think a "function" exists, but i wou

[PHP] Re: Array sizes?

2006-02-08 Thread Barry
Anders Norrbring wrote: Maybe I'm just blind, but I can't find any way to count an array size in bytes? I have a quite big array with multiple data formats in it, and I would like to know how big it is in bytes... I don't think a "function" exists, but i would probably use (for benchmarking)

[PHP] Re: array of checkbox values

2006-01-12 Thread Sjef
Interesting way to solve the problem. I thought about checking whether the keys are present (if not the checkbox is set to "N".) I wil definitily try this option as well. Thxs all! Sjef "Al" <[EMAIL PROTECTED]> schreef in bericht news:[EMAIL PROTECTED] > Sjef Janssen wrote: >> Hallo, >> I have a

[PHP] Re: array of checkbox values

2006-01-11 Thread Al
Sjef Janssen wrote: Hallo, I have a form with a number of checkboxes grouped together. The value of these boxes is stored in an array: $used[]. Now I found that the value of checked boxes (value = 'Y') are stored in the array while non checked boxes are not stored at all. This makes the array inc

[PHP] Re: array of checkbox values

2006-01-11 Thread James Benson
Do something like: $checkboxes = array('food','drink','smoking'); // display the checkboxes foreach($checkboxes as $checkbox) { echo "$checkbox: "; } Then when processing the form input check if each of the $checkboxes array values are present, if not, you can set to something else s

Re: [PHP] Re: array of checkbox values

2006-01-11 Thread Philip Hallstrom
Would it be enough to set a key for each checkbox, for example explicitly say: checkbox[1] checkbox[2] checkbox[3] then a non checked box will have an empty string as a value, whereas the checked ones will have a value of 'Y'. Nope. That's the problem. If a checkbox is unchecked the browser do

[PHP] Re: array of checkbox values

2006-01-11 Thread Sjef
Would it be enough to set a key for each checkbox, for example explicitly say: checkbox[1] checkbox[2] checkbox[3] then a non checked box will have an empty string as a value, whereas the checked ones will have a value of 'Y'. Sjef "David Dorward" <[EMAIL PROTECTED]> schreef in bericht news:[E

[PHP] Re: array of checkbox values

2006-01-11 Thread David Dorward
Sjef Janssen wrote: > I have a form with a number of checkboxes grouped together. The value of > these boxes is stored in an array: $used[]. Now I found that the value of > checked boxes (value = 'Y') are stored in the array while non checked > boxes are not stored at all. This makes the array inc

Re: [PHP] Re: array carrying from one php page to another

2005-12-09 Thread Jochem Maas
Ford, Mike wrote: On 08 December 2005 16:47, Sandy Keathley wrote: ... . . $_SESSION['array'] = serialize($array); Why on earth would you want to serialize an array you're adding to the session? That's just a terrible waste of good machine cycles. terrible, very. too many hits to the

RE: [PHP] Re: array carrying from one php page to another

2005-12-09 Thread Ford, Mike
On 08 December 2005 16:47, Sandy Keathley wrote: > > I have an array $journal that I want to carry from a page (where it > > was created) to another page (a popup that shows the variables > > contents). Is this automatically available? or do I have to do > > something special to php?? > > One wa

[PHP] Re: array carrying from one php page to another

2005-12-08 Thread Sandy Keathley
> I have an array $journal that I want to carry from a page (where it was > created) to another page (a popup that shows the variables contents). Is > this automatically available? or do I have to do something special to php?? One way: $serArray = serialize($array); At other end: $array = un

[PHP] Re: array woes

2005-11-25 Thread Matt Monaco
Within grabQuotes(); if you do a var_dump($arg); (where $arg is $res[id]) is your vehicle name displayed? If it is, and you're using it correctly, make sure you're returning the value you'd like correctly. It might help to post your grabQuotes function as well as the code that displays $cars[]

[PHP] Re: Array: If i'm in the child array then how I tell the parent's key name..

2005-09-30 Thread M. Sokolewicz
Let me reply with a question first :) how do you get *to* the child? ;) post some code so we know. In 99.99% of the cases, the way you get to the child includes a way to find out the parent key (usually you foreach() to it, or something similair). - tul Scott Fletcher wrote: Suppose that I'm

[PHP] Re: Array within array

2005-09-30 Thread Ben Litton
I would do something like $fp = fopen($file_location, 'r'); while (!$fp) { $csv_line = fgetcsv($fp); //insert line into database here after appropriate validation and cleaning } On Fri, 30 Sep 2005 06:29:11 -0400, Chris <[EMAIL PROTECTED]> wrote: Greetings PHP community, I have a CSV text fil

[PHP] Re: Array Select from database

2005-09-28 Thread Mark Rees
Array ( [count] => 1 [0] => Array ( [clientaccountmanager] => Array ( [count] => 2 [0] => 210 [1] => 149 ) I've got the following Query="select * from client WHERE clientaccountmanager='$value of array1' OR '$2nd value of array 1'" So that the query loops through the whole array... -

[PHP] Re: array merge problem

2005-09-01 Thread JamesBenson
could this help If you want to completely preserve the arrays and just want to append them to each other, use the + operator: "data"); $result = $array1 + $array2; ?> http://www.php.net/manual/en/function.array-merge.php Ahmed Abdel-Aliem wrote: i have the array with the following st

[PHP] Re: array diff with both values returned

2005-05-06 Thread pete M
http://uk2.php.net/manual/en/function.array-diff.php http://uk2.php.net/manual/en/function.array-diff-assoc.php Blackwater Dev wrote: Hello, Is there a good way to get the difference in two arrays and have both values returned? I know I can use array_dif to see what is in one and not the other but

[PHP] Re: array from folder

2005-04-25 Thread Matthew Weier O'Phinney
* Ed Dorsch <[EMAIL PROTECTED]>: > Can PHP generate an array based on file names in a folder? > > For example, if I have a folder called "photos" that includes three > files -- tree.jpg, house.jpg and boat.jpg -- can PHP "look" at the > file and generate a variable $photos = array ("tree", > "hous

[PHP] Re: array search

2005-01-23 Thread Malcolm
Ah so -- array_search only works on values ? That probably accounts for my first day or so, thanks. I've got it now. On Sun, 23 Jan 2005 19:22:32 +0100, M. Sokolewicz <[EMAIL PROTECTED]> wrote: Malcolm wrote: Hello All, I've been trying for days now to make this work. I'm trying to search my

[PHP] Re: array search

2005-01-23 Thread M. Sokolewicz
Malcolm wrote: Hello All, I've been trying for days now to make this work. I'm trying to search my array for a value and return the key. I get the visitor's IP and try this -- this is the latest, I've tried a few functions to echo the name associated with the viz_ip. $viz_ip= $_SERVER['REMOTE_A

[PHP] Re: array walk and class member functions

2005-01-12 Thread Jason Barnett
Tom wrote: Hi I'm batting my head against a wall on this one... I have a class that has a constructor which sets some initial conditions, and then a public function that does some work. I want to be able to call this function from an external array_walk call, but when I try and reference it as $

[PHP] Re: Array unset

2004-11-17 Thread Greg Beaver
Bruno b b magalhães wrote: So, the question, how resort the numeric values to 1,2,3,4? http://www.php.net/array_values Greg -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

[PHP] Re: Array unset

2004-11-17 Thread Sebastian Mendel
Bruno b b magalhães wrote: The problem is that when I delete an specific array, it outputs something like this: ( [0] => Array ( [moduleId] => 4 [moduleName] => Contents [modulePath] => contents [moduleAliasPath] => [moduleC

[PHP] Re: Array to $_GET variable

2004-11-10 Thread Sebastian Mendel
Mike Smith wrote: I am trying to cache a database recordset so users can sort, etc without hitting the database everytime. I'm using ADODB to access a MSSQL database. $s = "SELECT id, part, description FROM parts\n"; $r = $db->Execute($s); $parts = array(id=>array(),part=>array(),desc=>array()) whi

Re: [PHP] Re: Array Losing value

2004-07-20 Thread Justin Patrin
On Tue, 20 Jul 2004 10:50:04 -0500 (CDT), Jonathan Villa <[EMAIL PROTECTED]> wrote: > nevermind, I found a work around for it... > > I still would like to know why the value is lost. > What's the "work-around"? -- DB_DataObject_FormBuilder - The database at your fingertips http://pear.php.net/

Re: [PHP] Re: Array Losing value

2004-07-20 Thread Jonathan Villa
nevermind, I found a work around for it... I still would like to know why the value is lost. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Re: Array Losing value

2004-07-20 Thread Jonathan Villa
>> >> if I die(sizeof($objDBI->Fetch_Array($objDBI->getResultID( within >> the >> DBI method, it return the correct value, however if I do >> >> $retval = $objDBI->Fetch_Array($objDBI->getResultID()); >> die(sizeof($retVal)); > > $retval != $retVal > > -- > PHP General Mailing List (http://www.

[PHP] Re: Array Losing value

2004-07-19 Thread Jason Barnett
if I die(sizeof($objDBI->Fetch_Array($objDBI->getResultID( within the DBI method, it return the correct value, however if I do $retval = $objDBI->Fetch_Array($objDBI->getResultID()); die(sizeof($retVal)); $retval != $retVal -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit

[PHP] Re: array indexes as arguments to a function

2004-07-13 Thread Aidan Lister
I don't understand what you're asking. If you want to return a portion of an array, simple return the element holding it. In your example: POST["var1_arr"]["dim1"]["dim2"] return var1_arr; Will return whatever lives in var1_arr. Have a play around, you can see what a variable contains using pr

Re: [PHP] Re: Array Sorting Headaches

2004-04-19 Thread Torsten Roehr
> > OK, so it's just the other way round - I see. Instead of deleting the entry > > with the highest expiry date we delete all the others: > > > > foreach ($foo as $key => $value) { > > > > $tempArray = array(); > > > > foreach ($value as $subkey => $subvalue) { > > > >

Re: [PHP] Re: Array Sorting Headaches

2004-04-19 Thread Burhan Khalid
Torsten Roehr wrote: Well, it does some sorting, but not quite what I'm after :( I've managed to get the list so that all the (sub) entries are sorted in the correct order. Now its just a matter of finding the highest expire date for /each/ domain, and delete the other entries for that domain. S

Re: [PHP] Re: Array Sorting Headaches

2004-04-19 Thread Torsten Roehr
> Well, it does some sorting, but not quite what I'm after :( > > I've managed to get the list so that all the (sub) entries are sorted in > the correct order. Now its just a matter of finding the highest expire > date for /each/ domain, and delete the other entries for that domain. > So, in the e

Re: [PHP] Re: Array Sorting Headaches

2004-04-19 Thread Burhan Khalid
Torsten Roehr wrote: "Burhan Khalid" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] Torsten Roehr wrote: "Burhan Khalid" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] Greetings everyone : Having a hard time with this one. I have a multi-dim array $foo[$x][$y]['key']

Re: [PHP] Re: Array Sorting Headaches

2004-04-19 Thread Torsten Roehr
"Burhan Khalid" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Torsten Roehr wrote: > > > "Burhan Khalid" <[EMAIL PROTECTED]> wrote in message > > news:[EMAIL PROTECTED] > > > >>Greetings everyone : > >> > >> Having a hard time with this one. I have a multi-dim array > >>$foo[$x][$

Re: [PHP] Re: Array Sorting Headaches

2004-04-18 Thread Burhan Khalid
Torsten Roehr wrote: "Burhan Khalid" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] Greetings everyone : Having a hard time with this one. I have a multi-dim array $foo[$x][$y]['key'], where $x and $y are numeric. Here is some sample data [ snipped ] I need to filter the results

[PHP] Re: Array Sorting Headaches

2004-04-18 Thread Torsten Roehr
"Burhan Khalid" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Greetings everyone : > >Having a hard time with this one. I have a multi-dim array > $foo[$x][$y]['key'], where $x and $y are numeric. Here is some sample data : > > Array > ( > > [$x] => Array > ( >

[PHP] Re: array data

2004-02-11 Thread memoimyself
Hello Imran, On 12 Feb 2004 at 1:17, Imran Asghar wrote: > Hi, > > Is not working, is it correct way > > File1.php > > > > > > File2.php > > echo $colors[0]; > echo $colors[1]; > echo $colors[2]; > echo $colors[4]; > ?> > > > > imee > I'm afraid

[PHP] Re: array data

2004-02-11 Thread pete M
Think this is what u want Imran Asghar wrote: Hi, Is not working, is it correct way File1.php $v { ?> File2.php echo $colors[1]; echo $colors[2]; echo $colors[4]; ?> imee -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: h

RE: [PHP] Re: array block

2004-01-31 Thread Shawn McKenzie
'href' => 'foo', 'title' => 'bar', 'style' => 'amet' ) ); foreach ($menu as $array) { $tag = " $v) { $tag .= " $k=\"$v\"&

Re: [PHP] Re: array block

2004-01-31 Thread Brian V Bonini
On Fri, 2004-01-30 at 22:48, Shawn McKenzie wrote: > You would need to give an example of what you mean by change dynamically, > because if you can't predict the key indexes then how can you know which > ones to use in your anchor tag? say this: $menu = array ( 'link1' => array(

Re: [PHP] Re: array block

2004-01-31 Thread Jason Wong
On Saturday 31 January 2004 11:48, Shawn McKenzie wrote: > You would need to give an example of what you mean by change dynamically, > because if you can't predict the key indexes then how can you know which > ones to use in your anchor tag? foreach ($arr as $key => $value) { echo "Key: $k

Re: [PHP] Re: array block

2004-01-30 Thread Shawn McKenzie
You would need to give an example of what you mean by change dynamically, because if you can't predict the key indexes then how can you know which ones to use in your anchor tag? -Shawn "Brian V Bonini" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] -- PHP General Mailing List (htt

Re: [PHP] Re: array block

2004-01-30 Thread Brian V Bonini
On Fri, 2004-01-30 at 18:47, Shawn McKenzie wrote: > Sorry, $k should be $text. > > foreach ($menu as $text => $array) { > $url = $array['url']; > $title = $array['title']; > > echo "$text\n"; > } > Gotcha, thanks! That'll work for this but for arguments sake what if the inner array were to

[PHP] Re: array block

2004-01-30 Thread Shawn McKenzie
Sorry, $k should be $text. foreach ($menu as $text => $array) { $url = $array['url']; $title = $array['title']; echo "$text\n"; } "Shawn McKenzie" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > foreach ($menu as $text => $array) { > $url = $array['url']; > $title = $array['ti

[PHP] Re: array block

2004-01-30 Thread Shawn McKenzie
foreach ($menu as $text => $array) { $url = $array['url']; $title = $array['title']; echo "$k\n"; } HTH -Shawn "Brian V Bonini" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > I'm having array block, trying to format the data in a two dimensional > associative array. > > $menu =

[PHP] Re: array block

2004-01-30 Thread John Schulz
Brian V Bonini wrote: I'm having array block, trying to format the data in a two dimensional associative array. foreach($menu as $k => $v) { etc.. need to end up with link(x) Since it's two-dimensional, the $v you're getting is actually an array. So you'll have to iterate through the outer arra

[PHP] Re: Array Key Test

2004-01-12 Thread Justin Patrin
Cameron B. Prince wrote: Hi, How would I go about determining if a specific key exists in an array? I want to see if $conf['hOpt'] is defined. is_array only works at the $conf level. You want: if(isset($conf['hOpt'])) { ... } You should always use isset to check if a variable is set, whether it

[PHP] Re: array data to XML

2003-12-24 Thread Manuel Lemos
Hello, On 12/24/2003 02:44 PM, Chakravarthy Cuddapah wrote: Is it possible to format data in array to XML and display ? This class seems to do what you want. It requires DOM XML extension. Class: XML Array http://www.phpclasses.org/xmlarray You may also want to try this class for generating XML d

[PHP] Re: array data to XML

2003-12-24 Thread Matt Grimm
Of course. If it's a simple (short) array, you can just create a string with the XML tags and array values, and write that to a file with an XML extension. More sexy would be to use the DOMXML functions in PHP. http://us3.php.net/manual/en/ref.domxml.php Guy named Kris wrote a great XML -> PHP s

[PHP] RE: Array --> If

2003-11-05 Thread Jason Williard
Thanks! That did the trick. Jason Williard -Original Message- From: Greg Beaver [mailto:[EMAIL PROTECTED] Sent: Wednesday, November 05, 2003 6:55 PM To: Jason Williard Cc: [EMAIL PROTECTED] Subject: Re: Array --> If Hi Jason, perhaps: Regards, Greg -- phpDocumentor http://www.phpdo

[PHP] Re: Array --> If

2003-11-05 Thread Greg Beaver
Hi Jason, perhaps: $cases = array(5, 15, 30, 60, 90, 120); if (in_array($count, $cases)) { include 'page.php'; } ?> Regards, Greg -- phpDocumentor http://www.phpdoc.org Jason Williard wrote: I am building a script that I would like to have do a specific task based on whether specific c

[PHP] Re: Array to string?

2003-10-15 Thread Gabriel Peugnet
When I needed it I could'n find it so I made my own. function arrayToStr( $arr ){ $str = ""; while( true ){ $linea = current($arr); $str = $str . $linea; if( next($arr) == FALSE ){ break; } $str = str . "\n";// a newline separates each element.

[PHP] Re: Array, object problem....

2003-09-19 Thread george
"point" <[EMAIL PROTECTED]> wrote in message news:<[EMAIL PROTECTED]>... > Huhgood news :))) > > Just solved it : > > I'm on the role.. > > Y! > > :))) > - Your solution would be helpful. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, v

[PHP] Re: array encapsulate

2003-09-12 Thread Curt Zirzow
On Fri, 12 Sep 2003 18:58:22 -0400, Bill <[EMAIL PROTECTED]> wrote: I'd like to do this, but it produces an error: if ($_POST{["detail"][11][116]} && !$_POST{["detailtext"][19][114]}) { so I'm left doing this if ($_POST["detail"][11][116] && !$_POST["detailtext"][19][114]) { How can I encapsul

[PHP] Re: ARRAY QUESTION

2003-07-24 Thread Kevin Stone
"Dale Hersh" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > I have a question regarding the count function. Here goes: > > Lets pretend I have this array called myStuff. If I add two elements to > myStuff and call the count function, I will get a result of 2. My question > is how do

[PHP] Re: Array Dump

2003-06-27 Thread Bobby Patel
look at strlen() at php.net "Daniel J. Rychlik" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] Hmm, I just noticed that array dump counts the number of charaters and white space and lables that number string... What function name is that ? The string counter I mean ? -Dan -- PHP

[PHP] Re: Array Sorting

2003-06-19 Thread Mark Clarkstone
I found this Great PHP Starter site check it out http://www.htmlite.com/PHPintro.php "Ashley M. Kirchner" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > > I have an array that looks like this: > > $i = 0; > $item[$i] = array( 'link' => 'http://...', >'image

[PHP] Re: array

2003-06-12 Thread R'twick Niceorgaw
Your code works fine here (Apache 1.3.27/PHP 4.3.2) However you can try $room_type=array(); $room_type[0]=Array(); $room_type[0][0]=4; echo "value in array is ".$room_type[0][0]; HTH R'twick "Diana Castillo" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > If I write a code like t

[PHP] Re: Array[array]

2003-06-10 Thread Joaco
Try this: Array[i][j] where i is the index of the array stored in the array and j is the index of the value in the stored array. "Erich Kolb" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] How do I get a value from an array thats inside of an array?

[PHP] Re: Array sorting

2003-02-07 Thread Philip Hallstrom
never done it, but check out: http://www.php.net/manual/en/function.array-multisort.php On Sat, 8 Feb 2003, Zydox wrote: > My question is if anyone have any idé on how to sort this array so that the > names and ages are sorted after Close Friend, Friend, Wife and last > Family... > > $A[] = arra

[PHP] Re: Array find a element

2003-02-04 Thread Bobby Patel
look at array_key_exists "Narciso Miguel Rodrigues" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > Is possible to do something like > > if ($username in $users) ... or i need to do a foreach($user){...} > > Thks > > [MsR] > -- PHP General Mailing List (ht

[PHP] Re: array with session

2002-11-29 Thread Craig
Files are attached.. Craig "Craig" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > You should have session_start(); on every page that you want to hold the > session. > > The way I would do what you are trying to achieve is go the $_SUPERGLOBALS > way.. > > on

[PHP] Re: array with session

2002-11-29 Thread Craig
You should have session_start(); on every page that you want to hold the session. The way I would do what you are trying to achieve is go the $_SUPERGLOBALS way.. on the submit_information.php page: \n"; } ?> Also, another good way of debugging etc is to use the print_r() function (http://w

[PHP] Re: Array Searching

2002-11-15 Thread Joel Boonstra
> i have an array like: > > Array > ( > [1] => Array > ( > [alias] => foo > ... > ) > [2] => Array > ( > [alias] => bar > ... > ) > ... > ) > > I need some way to find out, if an alias "foo" is in the array.

[PHP] Re: =array within an html table=

2002-10-08 Thread @ Edwin
I think this is more of an HTML problem than a PHP... Put it inside $here (or $here whichever you need) and I'm sure the problem will go away. - E "Anthony Ritter" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > I'd like to have the record data - $current - *w

[PHP] Re: Array Javascript

2002-09-06 Thread lallous
if you have an array in javascript: array1 = [1,2,3,4,5,6,7,8,'test']; etc... you can join it in JavaScript to make it a one string as: array1 = array1.join('|'); then split in PHP to make it back an array: good luck, "Kale" <[EMAIL PROTECTED]> wrote in message 002c01c254cc$fe8eace0$7800a8c

[PHP] Re: array and a class

2002-08-16 Thread Pafo
solved it thx anyway "Pafo" <[EMAIL PROTECTED]> skrev i meddelandet [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > i got my nice looking class like this: > > class Relic { > var $RelicName; > var $RelicType; > var $RelicRealm; > var $RelicOwner; > > function PrintInfo() { >print "$t

  1   2   >