Hi gang:
What's a better/shorter way to write this?
$first_name = $_SESSION['first_name'] ? $_SESSION['first_name'] : null;
$first_name = isset($_POST['first_name']) ? $_POST['first_name'] : $first_name;
$_SESSION['first_name'] = $first_name;
Cheers,
tedd
_
On Thu, Mar 15, 2012 at 11:04, Tedd Sperling tedd.sperl...@gmail.com wrote:
Hi gang:
What's a better/shorter way to write this?
$first_name = $_SESSION['first_name'] ? $_SESSION['first_name'] : null;
$first_name = isset($_POST['first_name']) ? $_POST['first_name'] :
$first_name;
Hello, when I pass a variable whose value originally came from $_GET
or $_REQUEST to fwrite, fwrite behaves as if it was passed an empty
string. Note that the file is successfully opened and written to by
the script, but the variable that originally came from $_GET does not
have its value
i hope using set_exception_handler and set_error_handler in php extension
code.
hi, all:
i write php monitor extension now.
1. question
i hope using set_exception_handler or set_error_handler in
PHP_RINIT_FUNCTION()
for example:
PHP_RINIT_FUNCTION(my)
{
How about this?
$first_name = @$_POST['first_name'] or $first_name =
$_SESSION['first_name'] ? $_SESSION['first_name'] : null;
Thanks,
Michael
On Fri, Mar 16, 2012 at 2:13 AM, Daniel Brown danbr...@php.net wrote:
On Thu, Mar 15, 2012 at 11:04, Tedd Sperling tedd.sperl...@gmail.com wrote:
Hi
On Thu, Mar 15, 2012 at 11:30, Larry lrr...@gmail.com wrote:
Hello, when I pass a variable whose value originally came from $_GET
or $_REQUEST to fwrite, fwrite behaves as if it was passed an empty
string. Note that the file is successfully opened and written to by
the script, but the variable
On Thu, Mar 15, 2012 at 11:53 AM, Daniel P. Brown
daniel.br...@parasane.net wrote:
On Thu, Mar 15, 2012 at 11:30, Larry lrr...@gmail.com wrote:
Hello, when I pass a variable whose value originally came from $_GET
or $_REQUEST to fwrite, fwrite behaves as if it was passed an empty
string. Note
2012/3/15 Jeremy Wei shuimuqing...@gmail.com:
I read the manual about method visibility, but i can't understand the
code below:
?php
class Bar
{
public function test() {
$this-testPrivate();
$this-testPublic();
}
public function testPublic() {
echo
On 3/15/2012 9:04 AM, Tedd Sperling wrote:
What's a better/shorter way to write this?
$first_name = $_SESSION['first_name'] ? $_SESSION['first_name'] : null;
$first_name = isset($_POST['first_name']) ? $_POST['first_name'] : $first_name;
$_SESSION['first_name'] = $first_name;
Better:
On Thu, Mar 15, 2012 at 4:59 PM, Larry lrr...@gmail.com wrote:
On Thu, Mar 15, 2012 at 11:53 AM, Daniel P. Brown
daniel.br...@parasane.net wrote:
On Thu, Mar 15, 2012 at 11:30, Larry lrr...@gmail.com wrote:
Hello, when I pass a variable whose value originally came from $_GET
or $_REQUEST to
On Thu, Mar 15, 2012 at 5:25 PM, Michael Clark mcl...@insidesales.com wrote:
On 3/15/2012 9:04 AM, Tedd Sperling wrote:
What's a better/shorter way to write this?
$first_name = $_SESSION['first_name'] ? $_SESSION['first_name'] : null;
$first_name = isset($_POST['first_name']) ?
I thought that fgetcsv returned an array. I can work with it like an
array but I get the following warning when using it
|Warning: implode(): Invalid arguments passed on line 155
154 $csvCurrentLine = fgetcsv($csvFile, 4096, ',');
155 $currentLine = implode(,, $csvCurrentLine);
|
On Thu, Mar 15, 2012 at 6:09 PM, Jay Blanchard
jay.blanch...@sigmaphinothing.org wrote:
I thought that fgetcsv returned an array. I can work with it like an array
but I get the following warning when using it
|Warning: implode(): Invalid arguments passed on line 155
154 $csvCurrentLine
On 3/15/2012 12:23 PM, Matijn Woudt wrote:
On Thu, Mar 15, 2012 at 6:09 PM, Jay Blanchard
jay.blanch...@sigmaphinothing.org wrote:
I thought that fgetcsv returned an array. I can work with it like an array
but I get the following warning when using it
|Warning: implode(): Invalid arguments
On 03/15/2012 10:09 AM, Jay Blanchard wrote:
I thought that fgetcsv returned an array. I can work with it like an
array but I get the following warning when using it
|Warning: implode(): Invalid arguments passed on line 155
154 $csvCurrentLine = fgetcsv($csvFile, 4096, ',');
155 $currentLine =
On Thu, Mar 15, 2012 at 1:29 PM, Jay Blanchard
jay.blanch...@sigmaphinothing.org wrote:
On 3/15/2012 12:23 PM, Matijn Woudt wrote:
On Thu, Mar 15, 2012 at 6:09 PM, Jay Blanchard
jay.blanch...@sigmaphinothing.org wrote:
I thought that fgetcsv returned an array. I can work with it like an
Jay Blanchard wrote:
154 $csvCurrentLine = fgetcsv($csvFile, 4096, ',');
155 $currentLine = implode(,, $csvCurrentLine);
I am using it in a loop. End Of File is an error?
You certainly need to break out on $csvCurrentLine = false which indicates end
of file at least.
My own
On Thu, Mar 15, 2012 at 6:40 PM, Andrew Ballard aball...@gmail.com wrote:
On Thu, Mar 15, 2012 at 1:29 PM, Jay Blanchard
jay.blanch...@sigmaphinothing.org wrote:
On 3/15/2012 12:23 PM, Matijn Woudt wrote:
On Thu, Mar 15, 2012 at 6:09 PM, Jay Blanchard
jay.blanch...@sigmaphinothing.org
On 15 Mar 2012, at 15:13, Daniel Brown wrote:
On Thu, Mar 15, 2012 at 11:04, Tedd Sperling tedd.sperl...@gmail.com wrote:
Hi gang:
What's a better/shorter way to write this?
$first_name = $_SESSION['first_name'] ? $_SESSION['first_name'] : null;
$first_name = isset($_POST['first_name'])
On 15 Mar 2012, at 18:31, Stuart Dallas wrote:
On 15 Mar 2012, at 15:13, Daniel Brown wrote:
On Thu, Mar 15, 2012 at 11:04, Tedd Sperling tedd.sperl...@gmail.com wrote:
Hi gang:
What's a better/shorter way to write this?
$first_name = $_SESSION['first_name'] ? $_SESSION['first_name'] :
On Thu, Mar 15, 2012 at 14:31, Stuart Dallas stu...@3ft9.com wrote:
The @ prefix is banned from all code I go anywhere near - it's evil! I've
used the following 'V' function for a long time, primarily for accessing the
superglobals but it works for any array.
?php
session_start();
On 15 Mar 2012, at 18:35, Daniel Brown wrote:
On Thu, Mar 15, 2012 at 14:31, Stuart Dallas stu...@3ft9.com wrote:
The @ prefix is banned from all code I go anywhere near - it's evil! I've
used the following 'V' function for a long time, primarily for accessing the
superglobals but it
On Mar 15, 2012, at 11:35 AM, Daniel Brown wrote:
On Thu, Mar 15, 2012 at 14:31, Stuart Dallas stu...@3ft9.com wrote:
The @ prefix is banned from all code I go anywhere near - it's evil!
For the most part, I agree with you,
Hmm... I use it on my web pages (unless I'm testing)
On Thu, Mar 15, 2012 at 12:21 PM, Matijn Woudt tijn...@gmail.com wrote:
On Thu, Mar 15, 2012 at 4:59 PM, Larry lrr...@gmail.com wrote:
On Thu, Mar 15, 2012 at 11:53 AM, Daniel P. Brown
daniel.br...@parasane.net wrote:
On Thu, Mar 15, 2012 at 11:30, Larry lrr...@gmail.com wrote:
Hello, when I
On 15 Mar 2012, at 18:48, sono...@fannullone.us wrote:
On Mar 15, 2012, at 11:35 AM, Daniel Brown wrote:
On Thu, Mar 15, 2012 at 14:31, Stuart Dallas stu...@3ft9.com wrote:
The @ prefix is banned from all code I go anywhere near - it's evil!
For the most part, I agree with you,
On Thu, Mar 15, 2012 at 7:51 PM, Larry lrr...@gmail.com wrote:
On Thu, Mar 15, 2012 at 12:21 PM, Matijn Woudt tijn...@gmail.com wrote:
On Thu, Mar 15, 2012 at 4:59 PM, Larry lrr...@gmail.com wrote:
On Thu, Mar 15, 2012 at 11:53 AM, Daniel P. Brown
daniel.br...@parasane.net wrote:
On Thu, Mar
On Thu, 2012-03-15 at 18:52 +, Stuart Dallas wrote:
On 15 Mar 2012, at 18:48, sono...@fannullone.us wrote:
On Mar 15, 2012, at 11:35 AM, Daniel Brown wrote:
On Thu, Mar 15, 2012 at 14:31, Stuart Dallas stu...@3ft9.com wrote:
The @ prefix is banned from all code I go anywhere
On Thu, Mar 15, 2012 at 11:04 AM, Tedd Sperling tedd.sperl...@gmail.com wrote:
Hi gang:
What's a better/shorter way to write this?
$first_name = $_SESSION['first_name'] ? $_SESSION['first_name'] : null;
$first_name = isset($_POST['first_name']) ? $_POST['first_name'] :
$first_name;
On Thu, Mar 15, 2012 at 2:57 PM, Matijn Woudt tijn...@gmail.com wrote:
On Thu, Mar 15, 2012 at 7:51 PM, Larry lrr...@gmail.com wrote:
On Thu, Mar 15, 2012 at 12:21 PM, Matijn Woudt tijn...@gmail.com wrote:
On Thu, Mar 15, 2012 at 4:59 PM, Larry lrr...@gmail.com wrote:
On Thu, Mar 15, 2012 at
On Thu, Mar 15, 2012 at 8:41 PM, Larry lrr...@gmail.com wrote:
On Thu, Mar 15, 2012 at 2:57 PM, Matijn Woudt tijn...@gmail.com wrote:
On Thu, Mar 15, 2012 at 7:51 PM, Larry lrr...@gmail.com wrote:
On Thu, Mar 15, 2012 at 12:21 PM, Matijn Woudt tijn...@gmail.com wrote:
On Thu, Mar 15, 2012 at
On Thu, Mar 15, 2012 at 4:03 PM, Matijn Woudt tijn...@gmail.com wrote:
On Thu, Mar 15, 2012 at 8:41 PM, Larry lrr...@gmail.com wrote:
On Thu, Mar 15, 2012 at 2:57 PM, Matijn Woudt tijn...@gmail.com wrote:
On Thu, Mar 15, 2012 at 7:51 PM, Larry lrr...@gmail.com wrote:
On Thu, Mar 15, 2012 at
Using command line snmpget you can set an option to append leading 0's to
hex values -o0
So instead of
$macaddress = 0:1a:4b:c:8d:fb;
it would be
$macaddress = 00:1a:4b:0c:8d:fb;
is there any option using the extremely well documented php snmp extension
to do the same?
On 15 Mar 2012, at 20:07, Larry wrote:
On Thu, Mar 15, 2012 at 4:03 PM, Matijn Woudt tijn...@gmail.com wrote:
On Thu, Mar 15, 2012 at 8:41 PM, Larry lrr...@gmail.com wrote:
On Thu, Mar 15, 2012 at 2:57 PM, Matijn Woudt tijn...@gmail.com wrote:
On Thu, Mar 15, 2012 at 7:51 PM, Larry
[snip]
Please, don't do that. Use this instead:
while (($csvCurrentLine = fgetcsv($csvFile, 4096, ',')) !== FALSE) {
}
[/snip]
Not sure why, but ok. Thanks everyone!
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
On 15 Mar 2012, at 20:26, Jay Blanchard wrote:
[snip]
Please, don't do that. Use this instead:
while (($csvCurrentLine = fgetcsv($csvFile, 4096, ',')) !== FALSE) {
}
[/snip]
Not sure why, but ok. Thanks everyone!
An empty line would lead to $csvCurrentLine == array() which as a boolean
I don't not think there is a way without patching snmp.c prior to PHP
configuring.
You can always do:
$segment = explode(:, $macaddress);
foreach($segment as $seg){
$hex[] = str_pad($seg, 2, 0, STR_PAD_LEFT);
}
$macaddress = implode(:, $hex);
or use a preg replace function and match
36 matches
Mail list logo