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
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
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
>>
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
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
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",
>>
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
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
I believe it is because without the quotes, it is expecting a predefined
constant. With the quotes, it is expecting an array key. This is why if you
use a word that is not defined as a constant, php will first look for it as
a constant, won't find it, then looks through the array treating it like
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
> 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
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
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
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
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
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
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/
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
>>
>> 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.
> > 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) {
> >
> >
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
> 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
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']
"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][$
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
'href' => 'foo',
'title' => 'bar',
'style' => 'amet'
)
);
foreach ($menu as $array) {
$tag = " $v) {
$tag .= " $k=\"$v\"&
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(
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
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
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
> 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. Arac
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
Thanks for the input. I wasn't considering the possibility of making a
new table for kids until now which seems pretty logic when trying to
save space. The only thing missing now is how to assign a unique
relation number for each kid/relative. That's 1 for the first born, 2
for the second one, etc
This is what I was looking for!
Thank you very much.
"Miguel Cruz" <[EMAIL PROTECTED]> escreveu na mensagem
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> On Thu, 25 Apr 2002, Evandro Sestrem wrote:
> > My example wasn't good.
> >
> > I have a array of objects and want change its positions.
> >
On Thu, 25 Apr 2002, Evandro Sestrem wrote:
> My example wasn't good.
>
> I have a array of objects and want change its positions.
>
> $array = (obj2, obj1, obj3) --> $array = (obj1, obj2, obj3).
>
> Like TStringList.Exchange in Delphi.
>
> Sort() don't work in this case, because I want sort
Have you thought about swapping the elements, it's quite simple, I don't
know about more complicated methods using pointers
here's the code:
$layer is the array -
$currPos = array_search($HTTP_POST_VARS["selLayer"], $layer);
$temp = $layer[$currPos];
$layer[$currPos] = $layer[$cu
Thank YOU! It worked wonderful, I used a blank to separate the
content like this: $displn = implode("",$new_data);
Thank you again and thank you to everyone for helping me through this!
At 01:15 PM 9/19/2001 +0930, David Robley wrote:
>On Wed, 19 Sep 2001 12:28, Scott wrote:
> > That works, t
On Wed, 19 Sep 2001 12:28, Scott wrote:
> That works, thank you, but it prints at the top of my page, is there
> a way to store that array into a single variable?
>
Yes - implode()
--
David Robley Techno-JoaT, Web Maintainer, Mail List Admin, etc
CENTRE FOR INJURY STUDIES Flinders Uni
If you want to store all the values in the array in one variable (just as a
string with delimiters maybe?) Try this:
foreach ($array as $value) {
$temp .= $value . "|";
}
Josh Hoover
KnowledgeStorm, Inc.
[EMAIL PROTECTED]
Searching for a new IT solution for your company? Need to improve
;[EMAIL PROTECTED]>
>To: "Scott" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
>Sent: Tuesday, September 18, 2001 7:29 PM
>Subject: RE: [PHP] re: array question
>
>
> > perhaps i'm misunderstanding you, but why not use a for loop?
> >
> > fo
= $value";
}
- Original Message -
From: "Jack Dempsey" <[EMAIL PROTECTED]>
To: "Scott" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Tuesday, September 18, 2001 7:29 PM
Subject: RE: [PHP] re: array question
> perhaps i'm misunderstanding you,
Jack-
Thanks for the response, but I don't want to echo the array, I want to
bundle it into a new variable that will be called as part of a str_replace.
The array is created from a loop through all the navigation items in a
database.
The code is below, if I echo the code is formatted in the wron
perhaps i'm misunderstanding you, but why not use a for loop?
for($i=0;$imailto:[EMAIL PROTECTED]]
Sent: Tuesday, September 18, 2001 10:11 PM
To: [EMAIL PROTECTED]
Subject: [PHP] re: array question
Oh, that works wonders and for the first time in 24 hours I am
smiling! One more
thing to make i
You wrote:
> Also, consider using print or echo as opposed to printf. And lastly,
you
> really don't need to use mysql_free_result, PHP does this
automagically
> after the script dies. Sorry for picking on you, you may have your
> reasons. ;-)
Really? Then why was it that, when I neglected to
44 matches
Mail list logo