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 eth...@earthlink.net escreveu na mensagem news:0lim00hi3ihny...@mta4.srv.hcvlny.cv.net... Dear List - Here is a code snippet: $bla =

[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 eth...@earthlink.net escreveu na mensagem news:0lim00hi3ihny...@mta4.srv.hcvlny.cv.net... Dear List - Here is a code snippet: $bla = array(g1 = $results[7][6], h1 =

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 nos...@mckenzies.net 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

[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 this:

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 nos...@mckenzies.net 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

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 careful to

[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 would be

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

[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 out the

[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 it from a file

[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 the end of

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 always puts a

[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 relates to the parent

[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

[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 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 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

[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]= string(8) 11/06/07

[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

[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 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); if

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

2006-02-22 Thread Jason Karns
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 without quotes

[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 encountered

[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)

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

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

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 whether that

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

[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 form with

[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

[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

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

[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: input type=checkbox name=\$checkbox\ /; } Then when processing the form input check if each of the $checkboxes array values are present, if

[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

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 way:

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. sarcasmterrible, very. too many hits

[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); input type=hidden

[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

[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 file

[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

[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: ?php $array1 = array(); $array2 = array(1 = data); $result = $array1 + $array2; ? http://www.php.net/manual/en/function.array-merge.php Ahmed Abdel-Aliem

[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

[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, house,boat). Any

[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=

[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 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 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] =

[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 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())

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.net/) To

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

[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

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] 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 so

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][$y]['key'], where $x and $y

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'], where

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 end,

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.

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) { // add

[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 ( [0] =

[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 ? $colors = array('red','blue','green','yellow'); ? form action=file2.php method=post input type=hidden type name=colors value=?=$colors? /fomr ?php $colors =

[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 ? $colors = array('red','blue','green','yellow'); ? form action=file2.php method=post input type=hidden type name=colors value=?=$colors? /fomr

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: $key;

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 Shawn McKenzie
Subject: Re: [PHP] Re: array block 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

[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 a href=url title=titlelink(x)/a Since it's two-dimensional, the $v you're getting is actually an array. So you'll have to

[PHP] Re: array block

2004-01-30 Thread Shawn McKenzie
foreach ($menu as $text = $array) { $url = $array['url']; $title = $array['title']; echo a href=\$url\ title=\$title\$k/a\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

[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 a href=\$url\ title=\$title\$text/a\n; } Shawn McKenzie [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] foreach ($menu as $text = $array) { $url = $array['url'];

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 a href=\$url\ title=\$title\$text/a\n; } Gotcha, thanks! That'll work for this but for arguments sake what if the

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

[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

[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

[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

[PHP] Re: Array -- If

2003-11-05 Thread Greg Beaver
Hi Jason, perhaps: ?php $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

[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: ?php $cases = array(5, 15, 30, 60, 90, 120); if

[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, visit:

[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 encapsulate the array

[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 I

[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 BRvalue 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 this,

[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[] = array

[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

[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: ?php session_start(); $_SESSION['image'] = $_POST['image'];

[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 the

[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. Any idea how to do

[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 td$here/td (or trtd$here/td/tr 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 -

[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: ? $array1 = explode('|', $array1); ? good luck, Kale [EMAIL PROTECTED] wrote in

[PHP] Re: Array query - finding the key for a value

2002-08-16 Thread lallous
can do this: $array = array('apple', 'pear', 'orange', 'apricot'); $array = array_flip($array); $keyword = 'orange'; echo found '$orange' @ index: . $array[$keyword]; Don't use this method though! It makes your program slow! Elias Tim Fountain [EMAIL PROTECTED] wrote in message [EMAIL

[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: ?php class Relic { var $RelicName; var $RelicType; var $RelicRealm; var $RelicOwner; function PrintInfo() { print

Re: [PHP] Re: ARRAY, IF INSERT

2002-06-24 Thread Jesper Brunholm
César aracena wrote: The catch would be to make PHP to auto assign the relatives level by knowing it has to start from $i=1 and loop $i++ until no other kid is inserted. Now that I write it, it seems I could use a for loop, but what should be the structure of it using the $name 0 you told

RE: [PHP] Re: ARRAY, IF INSERT

2002-06-24 Thread César Aracena
the name 0 was a sql-query - it will return a ressource which will enable you to make something like $i=0; while($row = mysql_fetch_assoc($nameless_result){ #psuedo-code# # mysql_query=(insert into table set relativenumber = 'jr$i' where ID=$row[ID]); } [César L. Aracena] I think

[PHP] Re: ARRAY, IF INSERT

2002-06-21 Thread Jesper Brunholm
(i am new to these groups, but shouldn't there be a follow-up-to on a X-post?) César aracena wrote: I have this form in which one Administrator can insert new members and after that, in another page, a form where he/she can insert the new member’s sons daughters. I want to display a table

RE: [PHP] Re: ARRAY, IF INSERT

2002-06-21 Thread César Aracena
:56 AM To: [EMAIL PROTECTED]; [EMAIL PROTECTED] Subject: [PHP] Re: ARRAY, IF INSERT (i am new to these groups, but shouldn't there be a follow-up-to on a X-post?) César aracena wrote: I have this form in which one Administrator can insert new members and after that, in another page

[PHP] Re: array of objects???

2002-05-10 Thread J Smith
Might just be a typo, but in the function prototype for AddUser(), you have $oUser, but the array_push() argument says $objUser. J J. Anderson Scarbrough wrote: I have two classes. Organization and users. In the organization class I am try to keep an array of user objects but it does

  1   2   >