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 mat
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
[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:07, Larry wrote:
> On Thu, Mar 15, 2012 at 4:03 PM, Matijn Woudt wrote:
>> On Thu, Mar 15, 2012 at 8:41 PM, Larry wrote:
>>> On Thu, Mar 15, 2012 at 2:57 PM, Matijn Woudt wrote:
On Thu, Mar 15, 2012 at 7:51 PM, Larry wrote:
> On Thu, Mar 15, 2012 at 12:21 PM, Mat
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 Thu, Mar 15, 2012 at 4:03 PM, Matijn Woudt wrote:
> On Thu, Mar 15, 2012 at 8:41 PM, Larry wrote:
>> On Thu, Mar 15, 2012 at 2:57 PM, Matijn Woudt wrote:
>>> On Thu, Mar 15, 2012 at 7:51 PM, Larry wrote:
On Thu, Mar 15, 2012 at 12:21 PM, Matijn Woudt wrote:
> On Thu, Mar 15, 2012 a
On Thu, Mar 15, 2012 at 8:41 PM, Larry wrote:
> On Thu, Mar 15, 2012 at 2:57 PM, Matijn Woudt wrote:
>> On Thu, Mar 15, 2012 at 7:51 PM, Larry wrote:
>>> On Thu, Mar 15, 2012 at 12:21 PM, Matijn Woudt wrote:
On Thu, Mar 15, 2012 at 4:59 PM, Larry wrote:
> On Thu, Mar 15, 2012 at 11:53
On Thu, Mar 15, 2012 at 2:57 PM, Matijn Woudt wrote:
> On Thu, Mar 15, 2012 at 7:51 PM, Larry wrote:
>> On Thu, Mar 15, 2012 at 12:21 PM, Matijn Woudt wrote:
>>> On Thu, Mar 15, 2012 at 4:59 PM, Larry wrote:
On Thu, Mar 15, 2012 at 11:53 AM, Daniel P. Brown
wrote:
> On Thu, Mar 1
On Thu, Mar 15, 2012 at 11:04 AM, Tedd Sperling 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;
> $_SESSION['first_name'
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 wrote:
> >>>
> >>> The @ prefix is banned from all code I go anywhere n
On Thu, Mar 15, 2012 at 7:51 PM, Larry wrote:
> On Thu, Mar 15, 2012 at 12:21 PM, Matijn Woudt wrote:
>> On Thu, Mar 15, 2012 at 4:59 PM, Larry wrote:
>>> On Thu, Mar 15, 2012 at 11:53 AM, Daniel P. Brown
>>> wrote:
On Thu, Mar 15, 2012 at 11:30, Larry wrote:
> Hello, when I pass a va
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 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 12:21 PM, Matijn Woudt wrote:
> On Thu, Mar 15, 2012 at 4:59 PM, Larry wrote:
>> On Thu, Mar 15, 2012 at 11:53 AM, Daniel P. Brown
>> wrote:
>>> On Thu, Mar 15, 2012 at 11:30, Larry wrote:
Hello, when I pass a variable whose value originally came from $_GET
or
On Mar 15, 2012, at 11:35 AM, Daniel Brown wrote:
> On Thu, Mar 15, 2012 at 14:31, Stuart Dallas 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) so that i
On 15 Mar 2012, at 18:35, Daniel Brown wrote:
> On Thu, Mar 15, 2012 at 14:31, Stuart Dallas 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 a
On Thu, Mar 15, 2012 at 14:31, Stuart Dallas 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.
>
> session_start();
> $_SESSION['first_nam
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 wrote:
>>> Hi gang:
>>>
>>> What's a better/shorter way to write this?
>>>
>>> $first_name = $_SESSION['first_name'] ? $_SESSION['first_name'] : null
On 15 Mar 2012, at 15:13, Daniel Brown wrote:
> On Thu, Mar 15, 2012 at 11:04, Tedd Sperling 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['f
On Thu, Mar 15, 2012 at 6:40 PM, Andrew Ballard wrote:
> On Thu, Mar 15, 2012 at 1:29 PM, Jay Blanchard
> wrote:
>> On 3/15/2012 12:23 PM, Matijn Woudt wrote:
>>>
>>> On Thu, Mar 15, 2012 at 6:09 PM, Jay Blanchard
>>> wrote:
I thought that fgetcsv returned an array. I can work with it
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 'loo
On Thu, Mar 15, 2012 at 1:29 PM, Jay Blanchard
wrote:
> On 3/15/2012 12:23 PM, Matijn Woudt wrote:
>>
>> On Thu, Mar 15, 2012 at 6:09 PM, 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
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 3/15/2012 12:23 PM, Matijn Woudt wrote:
On Thu, Mar 15, 2012 at 6:09 PM, 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 $csvCur
On Thu, Mar 15, 2012 at 6:09 PM, 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, ',
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);
|
Ev
On Thu, Mar 15, 2012 at 5:25 PM, Michael Clark 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']) ? $_POST['first_name'] :
>>
On Thu, Mar 15, 2012 at 4:59 PM, Larry wrote:
> On Thu, Mar 15, 2012 at 11:53 AM, Daniel P. Brown
> wrote:
>> On Thu, Mar 15, 2012 at 11:30, Larry 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 emp
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:
$first_na
2012/3/15 Jeremy Wei :
> I read the manual about method visibility, but i can't understand the
> code below:
> class Bar
> {
> public function test() {
> $this->testPrivate();
> $this->testPublic();
> }
>
> public function testPublic() {
> echo "Bar::testPublic\n";
>
On Thu, Mar 15, 2012 at 11:53 AM, Daniel P. Brown
wrote:
> On Thu, Mar 15, 2012 at 11:30, Larry 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 opene
On Thu, Mar 15, 2012 at 11:30, Larry 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 that origina
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 wrote:
> On Thu, Mar 15, 2012 at 11:04, Tedd Sperling wrote:
>> Hi gang:
>>
>> What's a better/shorter wa
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)
{
set_exception_handler(my_exception_h
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 interpola
On Thu, Mar 15, 2012 at 11:04, Tedd Sperling 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;
> $_SESSION['first_name'] =
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
_
36 matches
Mail list logo