[PHP] Under which distribution(s) is PHP developed, compiled, and tested?

2010-12-15 Thread Dan Schaefer

Background (some of these facts may be well-known, and for that I apologize):
I'm running CentOS 5.5 on all servers, which only supports PHP 5.1.6
CentOS 5.5 is based off RHEL 5.5
Redhat has released RHEL 6 which supports PHP 5.3
CentOS has not released even a beta 6 version yet that supports PHP 5.2+


I was having a discussion with my bosses about what PHP release we are running on our systems. We 
have a few applications and packages that require and/or will work better with PHP 5.2+. I 
understand that no matter what Linux distribution I have, I can always download the source, compile, 
and install manually. My question is, when The PHP Group develops, compiles, and tests PHP for a 
release, what distribution(s) and versions do they use? And of those, which distribution is the most 
commonly used throughout the development team? What Internet references are there, if any, that show 
the major and/or minor Linux distributions that support which version of PHP?


FTR, I couldn't find an answer to these questions by Googling or in the 
php-general archives.

--
Dan Schaefer
Web Developer/Systems Analyst
Performance Administration Corp.


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Custom function

2011-02-16 Thread Dan Schaefer
In my code, I set the optional parameter to NULL and check for triple equals "===" or "!==" to see 
if the variable has been passed with a value. IMO, this is the safest way.


function MyFunction($x, $y, $z=NULL) {
if ($z !== NULL) {
// Do Something
}
}

Dan Schaefer
Web Developer/Systems Analyst
Performance Administration Corp.


On 2-15-2011 6:32 PM, Ron Piggott wrote:

Is there a way to make an optional flag in a custom function --- 2 parameters 
required, 1 optional?  Ron

The Verse of the Day
“Encouragement from God’s Word”
http://www.TheVerseOfTheDay.info



--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] json_encode confusion

2011-11-10 Thread Dan Schaefer

On 11/10/2011 09:45 AM, Bastien Koert wrote:

Morning all,

I've been having some fun with converting a text data file import into
a json object for storage.

I have a text file that is pipe delimited coming in via an upload. The
first row is the headers and the second row is the data.

Using this code:

$data = file("inline_Nov_8_2011.txt");

if(count($data)==2){

$keys   = explode("|", $data[0]);
$fields = explode("|", $data[1]); 

$combine = array_combine($keys, $fields);

$json = json_encode($combine);
}

After the combine, I get an array that looks like this

Array
(
 ['Legal Last Name '] =>  Andros
 ['Legal Middle Initial '] =>
 ['Legal First Name '] =>  Marisa
 ['Maiden/Other Name '] =>
 ['Social Insurance No. '] =>  123456789
 ['Date of Birth '] =>  2/1/1988
 ['Gender '] =>  Female
)

But the json encoded value looks like this (there are way more
elements but this should be enough to represent what I need to do).

{null:"Andros",null:"",null:"Marisa",null:"",null:"123456789",null:"2\/1\/1988",null:"Female"}

I have been googling for info about allowed values for the json keys,
but can't seem to find a clear doc on what is allowed and what isn't.
I have tried unquoted keys, replaced the spaced with underscores but
nothing I do seems to help.

When I echo out the json encoded data, the keys are all nulls.

Can someone point me in the correct direction? It may be that I need
to manually create the key names as an array first, which I was hoping
to avoid since the file format coming from the client is still in some
flux.

Just a thought: Try removing the spaces altogether, not by replacing 
them with underscores.


--
Dan


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php