[PHP] FW:
http://www.shinwa-kensetsu.sakura.ne.jp/bth7rz.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] FW:
If you're going to send hack attempts, at least adjust your clock so that it doesn't look like it took almost a month for your SPAM to get here. We're not the Pony Express. (And, no, PHP doesn't stand for Produced by Horses & Ponies.) On Thu, Apr 11, 2013 at 11:43 AM, Paul Novitski wrote: > http://www.shinwa-kensetsu.sakura.ne.jp/bth7rz.php > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > -- Network Infrastructure Manager http://www.php.net/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP]
On May 8, 2013, at 12:50 PM, Daniel Brown wrote: >If you're going to send hack attempts, at least adjust your clock > so that it doesn't look like it took almost a month for your SPAM to > get here. We're not the Pony Express. (And, no, PHP doesn't stand > for Produced by Horses & Ponies.) > > On Thu, Apr 11, 2013 at 11:43 AM, Paul Novitski > wrote: >> http://www.shinwa-kensetsu.sakura.ne.jp/bth7rz.php I'm not sure what's going on with Paul's account -- he doesn't "normally" do stuff like that. I even bought his book. Cheers, tedd PS: PHP + > "Produced by Horses & Ponies." ? You got too much time on your hands Daniel. As for me, I just wasted 20+ hours on a clueless client. It would be nice if people kept their word. _ tedd.sperl...@gmail.com http://sperling.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP]
On Wed, May 8, 2013 at 1:14 PM, Tedd Sperling wrote: > > PS: PHP + > "Produced by Horses & Ponies." ? You got too much time on your > hands Daniel. Sometimes I wish that were the case. Honestly, I think it's having a three-and-a-half-year-old daughter that's rubbing off on me. She's presently obsessed with princesses (fictional, of course --- no interest in Maria Antonia or even Kate Middleton yet). So you're just lucky I didn't acronymize it as the Pretty House of Princesses or something. And yes, I just made up the word acronymize. It may be Wednesday, but it feels more like a Friday. -- Network Infrastructure Manager http://www.php.net/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP]
On Wed, May 8, 2013 at 1:22 PM, Daniel Brown wrote: > On Wed, May 8, 2013 at 1:14 PM, Tedd Sperling > wrote: > > > > PS: PHP + > "Produced by Horses & Ponies." ? You got too much time on > your hands Daniel. > > And yes, I just made up the word acronymize. > That would be reverse acronymization :)
Re: [PHP] FW:
Yo, (And, no, PHP doesn't stand > for Produced by Horses & Ponies.) > > This is completely devastating -- -Dan Joseph http://www.danjoseph.me http://www.dansrollingbbq.com http://www.youtube.com/DansRollingBBQ
Re: [PHP] FW:
Dan Joseph wrote: >Yo, > > (And, no, PHP doesn't stand >> for Produced by Horses & Ponies.) >> >> >This is completely devastating Just noticed the original link has a nasty payload for android, I assume the same applies for other OSs (probably best not to check!) -- Sent from my Android phone with K-9 Mail. Please excuse my brevity. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP]
> So you're just lucky I didn't acronymize it as the Pretty House of > Princesses or something. And yes, I just made up the word > acronymize. It may be Wednesday, but it feels more like a Friday. > Why does this feel like a new function/feature for PHP now? Function acronymize($acronym) { // do stuff here now... :S } Steve -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP]
Steven Staples wrote: >> So you're just lucky I didn't acronymize it as the Pretty House of >> Princesses or something. And yes, I just made up the word >> acronymize. It may be Wednesday, but it feels more like a Friday. >> > >Why does this feel like a new function/feature for PHP now? > >Function acronymize($acronym) >{ > // do stuff here now... :S >} > >Steve Dont call it with the argument "php", you'll get stuck in a recursive loop! And its not even Friday! -- Sent from my Android phone with K-9 Mail. Please excuse my brevity. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP]
On Wed, May 8, 2013 at 1:26 PM, David OBrien wrote: > > That would be reverse acronymization :) You're absolutely correct. Deacronymize? -- Network Infrastructure Manager http://www.php.net/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP]
On Wed, May 8, 2013 at 3:13 PM, Steven Staples wrote: > > Why does this feel like a new function/feature for PHP now? > > Function acronymize($acronym) > { > // do stuff here now... :S > } -- Network Infrastructure Manager http://www.php.net/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: array_map() with multiple callback functions
On 5/7/2013 5:29 PM, George Langley wrote: Hi all. I want to apply strtolower() AND trim() to all items in an array. But I don't see a way to call multiple callbacks with the array_map() function. Are my two choices the following: // 1) nesting two array_map() calls $cleanData = array_map('trim',(array_map('strtolower',$rawData))); // 2) call my own function with array_walk() $cleanData = array_walk('myCleaner',$rawData); function myCleaner($passedData){ $cleanData = array_map('strtolower',$passedData); $cleanData = array_map('trim',$cleanData); } //(Of course, wouldn't bother with a function, just to call array_map twice...) Just seeing if there's a better way than having to go through the array twice to apply each callback separately. Thanks, Not sure if you have an answer to this yet, so I'll present my simpler approach. foreach ($my_array as &$v) { $v = trim($v); $v = strtolower($v); } -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] array_map() with multiple callback functions
On Tue, May 7, 2013 at 5:43 PM, Alex Nikitin wrote: > On Tue, May 7, 2013 at 4:29 PM, George Langley wrote: >> Hi all. I want to apply strtolower() AND trim() to all items in an array. >> But I don't see a way to call multiple callbacks with the array_map() >> function. >> Are my two choices the following: >> >> // 1) nesting two array_map() calls >> $cleanData = array_map('trim',(array_map('strtolower',$rawData))); >> >> >> // 2) call my own function with array_walk() >> $cleanData = array_walk('myCleaner',$rawData); >> >> function myCleaner($passedData){ >> $cleanData = array_map('strtolower',$passedData); >> $cleanData = array_map('trim',$cleanData); >> } >> //(Of course, wouldn't bother with a function, just to call array_map >> twice...) >> >> Just seeing if there's a better way than having to go through the array >> twice to apply each callback separately. Thanks, > Something like: > > $cleanData = array_map(function($str){return strtolower(trim($str));}, > $passedData); I'd go with this general approach, whether you use a named function or an anonymous function for the callback. I don't know how large the array is, but option #1 iterates the input array twice and option #2 iterates the array three times. If you eventually need to add additional functions to clean the input, they would add even more iterations. This approach only iterates once. Andrew -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] filesize question
On Tue, May 7, 2013 at 10:16 PM, Curtis Maurand wrote: > find -name *.js -exec removestring.php '{}' \; > > That's how I get the I put file name. I think that I need the if statement > to look at the filesize and make sure that I can open them and they are at > least the size of the string that I'm looking to cleanse. That's how you pass the name into the php script; how does $inputfile get set (via $argv somehow) once you're inside php? This line: >>> $inputline = fread($inputfile, filesize($argv[1])); Somehow, you opened $inputfile (assuming via fopen) by passing it a file name, presumably off the command line. Show me(us) where that happens. > Would that joomla.modules would use the ftp layer if it were turned on. Then > I wouldn't have to be scanning files dor malicious iframes or if clamav > coyld remove offending code without removing the entire file... I don't know anything about joomla. > tamouse mailing lists wrote: >> >> On Tue, May 7, 2013 at 8:16 AM, Curtis Maurand wrote: >>> >>> Hello, >>> I'm feeding a filename to a php script on the command line (command line >>> program). I run the following against it: >>> >>> $inputline = fread($inputfile, filesize($argv[1])); >>> >>> I'm getting an error complaining that the second parameter can't be '0' >> >> >> The thing to look for, is how did you get $inputfile out of the >> command line, and why you'd expect the file name to be in $argv[1] at >> that point? Marco's suggestion isn't really going to work as >> $inputfile will be a file handle, and filesize() needs the name of the >> file. Maybe want to give us a wider look at what your code is doing? >> >> Generically, you can wrap this >> up as: >> >> function binread_file($filename) >> { >> $handle = fopen($filename,'rb'); >> if (FALSE === $handle) die("Unable to open $filename"); >> $contents = fread($handle, filesize($filename)); >> if (FALSE === $contents) die("Unable to read $filename"); >> return $contents; >> } > > > -- > Sent from my Android phone with K-9 Mail. Please excuse my brevity. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: array_map() with multiple callback functions
On 2013-05-08, at 1:48 PM, Jim Giner wrote: > On 5/7/2013 5:29 PM, George Langley wrote: >> Hi all. I want to apply strtolower() AND trim() to all items in an array. >> But I don't see a way to call multiple callbacks with the array_map() >> function. >> Are my two choices the following: >> >> // 1) nesting two array_map() calls >> $cleanData = array_map('trim',(array_map('strtolower',$rawData))); >> >> >> // 2) call my own function with array_walk() >> $cleanData = array_walk('myCleaner',$rawData); >> >> function myCleaner($passedData){ >> $cleanData = array_map('strtolower',$passedData); >> $cleanData = array_map('trim',$cleanData); >> } >> //(Of course, wouldn't bother with a function, just to call array_map >> twice...) >> >> Just seeing if there's a better way than having to go through the array >> twice to apply each callback separately. Thanks, >> > Not sure if you have an answer to this yet, so I'll present my simpler > approach. > > foreach ($my_array as &$v) > { > $v = trim($v); > $v = strtolower($v); > } > > -- On 2013-05-07, at 3:43 PM, Alex Nikitin wrote: > Something like: > > $cleanData = array_map(function($str){return strtolower(trim($str));}, > $passedData); -- Thanks guys - will check both out to see what works best in my situation. George -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php