Re: [PHP] use preg_replace to nix and line with "display: none"
On Sun, Aug 9, 2009 at 12:17 AM, Rob Gould wrote: > I wish I could say this works, but I'm not having success with this pattern. > All the lines with display: none are still in the $bl string. > > On Aug 9, 2009, at 1:50 AM, LinuxManMikeC wrote: > > Reserved Frontstretch > > Tower Ticket to the Camping World 300 on Saturday > > Reserved Frontstretch Tower > > Ticket to the Daytona 500 on Sunday > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > Official Daytona 500 Race Week Program > > Benchwarmer Sports Souvenir Ticket Protector and Lanyard > > > > On Site Benchwarmer Tour Staff > > All Taxes and Service Charges > > > > > I'm CLOSE, but since the style = "display:[space]none" my preg_replace > > doesn't catch it. Can anyone help me determine the correct preg_replace > > pattern to do this? > > $bl = $_POST['bulletlist']; > > $pattern = '|^.+?display:none.+?$|mi'; > > $bl = preg_replace($pattern,'',$bl); > > -- > > PHP General Mailing List (http://www.php.net/) > > To unsubscribe, visit: http://www.php.net/unsub.php > > > > I found your use of ? rather... creative... Anyway, just add the > condition "0 or more whitespace" to your regex. > > $pattern = '|^.+display:\w*none.+$|'; > I found your use of ? rather... creative... Anyway, just add the > condition "0 or more whitespace" to your regex. > > $pattern = '|^.+display:\w*none.+$|'; > > > Sorry... my bad... its \s. I need some sleep. $pattern = '|^.+display:\s*none.+$|'; Also, if you're certain you'll only ever have one space there, you can just say that explicitly. $pattern = '|^.+display: none.+$|'; But I prefer to leave things open for robustness. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] use preg_replace to nix and line with "display: none"
Yay! That worked. Thanks! On Aug 9, 2009, at 1:53 AM, Michael A. Peters wrote: Rob Gould wrote: I have a bunch of bullets in a list coming from a previous post, and I need to eliminate any line from this string that contains "display: none" Reserved Frontstretch Tower Ticket to the Camping World 300 on Saturday Reserved Frontstretch Tower Ticket to the Daytona 500 on Sunday Official Daytona 500 Race Week Program Benchwarmer Sports Souvenir Ticket Protector and Lanyard On Site Benchwarmer Tour Staff All Taxes and Service Charges I'm CLOSE, but since the style = "display:[space]none" my preg_replace doesn't catch it. Can anyone help me determine the correct preg_replace pattern to do this? $bl = $_POST['bulletlist']; $pattern = '|^.+?display:none.+?$|mi'; $bl = preg_replace($pattern,'',$bl); Easy to do with xml tools if your input is easily manipulated by xml tools, but try this: $pattern = '/]*style="display: none[^>]*>/'; not tried myself. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] use preg_replace to nix and line with "display: none"
I wish I could say this works, but I'm not having success with this pattern. All the lines with display: none are still in the $bl string. On Aug 9, 2009, at 1:50 AM, LinuxManMikeC wrote: Reserved Frontstretch Tower Ticket to the Camping World 300 on Saturday Reserved Frontstretch Tower Ticket to the Daytona 500 on Sunday Official Daytona 500 Race Week Program Benchwarmer Sports Souvenir Ticket Protector and Lanyard On Site Benchwarmer Tour Staff All Taxes and Service Charges I'm CLOSE, but since the style = "display:[space]none" my preg_replace doesn't catch it. Can anyone help me determine the correct preg_replace pattern to do this? $bl = $_POST['bulletlist']; $pattern = '|^.+?display:none.+?$|mi'; $bl = preg_replace($pattern,'',$bl); -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php I found your use of ? rather... creative... Anyway, just add the condition "0 or more whitespace" to your regex. $pattern = '|^.+display:\w*none.+$|'; I found your use of ? rather... creative... Anyway, just add the condition "0 or more whitespace" to your regex. $pattern = '|^.+display:\w*none.+$|';
Re: [PHP] use preg_replace to nix and line with "display: none"
Rob Gould wrote: I have a bunch of bullets in a list coming from a previous post, and I need to eliminate any line from this string that contains "display: none" Reserved Frontstretch Tower Ticket to the Camping World 300 on Saturday Reserved Frontstretch Tower Ticket to the Daytona 500 on Sunday Official Daytona 500 Race Week Program Benchwarmer Sports Souvenir Ticket Protector and Lanyard On Site Benchwarmer Tour Staff All Taxes and Service Charges I'm CLOSE, but since the style = "display:[space]none" my preg_replace doesn't catch it. Can anyone help me determine the correct preg_replace pattern to do this? $bl = $_POST['bulletlist']; $pattern = '|^.+?display:none.+?$|mi'; $bl = preg_replace($pattern,'',$bl); Easy to do with xml tools if your input is easily manipulated by xml tools, but try this: $pattern = '/]*style="display: none[^>]*>/'; not tried myself. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] use preg_replace to nix and line with "display: none"
On Sat, Aug 8, 2009 at 11:14 PM, Rob Gould wrote: > I have a bunch of bullets in a list coming from a previous post, and I need > to eliminate any line from this string that contains "display: none" > > > Reserved Frontstretch > Tower Ticket to the Camping World 300 on Saturday > Reserved Frontstretch Tower > Ticket to the Daytona 500 on Sunday > > > > > > > > > > > > > > > > > > > Official Daytona 500 Race Week Program > Benchwarmer Sports Souvenir Ticket Protector and Lanyard > > On Site Benchwarmer Tour Staff > All Taxes and Service Charges > > > > > I'm CLOSE, but since the style = "display:[space]none" my preg_replace > doesn't catch it. Can anyone help me determine the correct preg_replace > pattern to do this? > > $bl = $_POST['bulletlist']; > $pattern = '|^.+?display:none.+?$|mi'; > $bl = preg_replace($pattern,'',$bl); > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > I found your use of ? rather... creative... Anyway, just add the condition "0 or more whitespace" to your regex. $pattern = '|^.+display:\w*none.+$|'; -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] use preg_replace to nix and line with "display: none"
I have a bunch of bullets in a list coming from a previous post, and I need to eliminate any line from this string that contains "display: none" Reserved Frontstretch Tower Ticket to the Camping World 300 on Saturday Reserved Frontstretch Tower Ticket to the Daytona 500 on Sunday Official Daytona 500 Race Week Program Benchwarmer Sports Souvenir Ticket Protector and Lanyard On Site Benchwarmer Tour Staff All Taxes and Service Charges I'm CLOSE, but since the style = "display:[space]none" my preg_replace doesn't catch it. Can anyone help me determine the correct preg_replace pattern to do this? $bl = $_POST['bulletlist']; $pattern = '|^.+?display:none.+?$|mi'; $bl = preg_replace($pattern,'',$bl); -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Readline Thread Safety Question
Hello, I am using PHP 5.3 with readline support. I read that PHP readline is never thread safe. I do not use the readline functions in a web application. What implications does this warning of thread safety have with respect to running normal web applications using apache2? Thank You, Mike -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: PHP programming strategy
On Sat, 8 Aug 2009 07:53:42 -0400, tedd.sperl...@gmail.com (tedd) wrote: >You don't need the width="210" height="300". For example, this works: > > > > Yanni Nx > Sally Riordan Scholarship, 2007- > I have read that if you omit the dimensions you will sometimes see the page reshuffle itself as it loads, because the browser starts loading, then finds the dimensions are incompatible with it's initial assumptions. I don't know how serious a problem this is, but if the dimensions prevent it happening I am happy to provide them. In my scheme of things has normal paragraph spacing, 'nrmltxtn' has zero spacing, and 'notetxtn' is a size smaller, also with zero line spacing. >Also, if you use first-child, it could be taken down to: > > > > Yanni Nx > Sally Riordan Scholarship, 2007- > Except that line 2 is smaller than line 1. In my scheme of things has normal paragraph spacing, 'nrmltxtn' has zero spacing, and 'notetxtn' is a size smaller, also with zero line spacing. I could redefine & for this class (provided I never want to use the normal values in it), but there is something to be said for having a standard set of fonts, and always knowing what I will get, rather than having mean something different every time I use it. And, as others have pointed out, a few thousand bytes more or less is totally immaterial. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] ZCE Question
On Sat, Aug 8, 2009 at 4:18 PM, Augusto Flavio wrote: > Has someone an clue about this zce question: > > The following is a common XML structure used in service oriented > architectures, what does it represent? > > > > > myMethod > > > HI! > > > > > > Answer... > None of the above > A fragment of a complete SOAP request > XML-RPC > REST > SOAP > > > i think the answer is: SOAP > > > some idea? > > > thanks > > Augusto Morais > Looks like XMLRPC to me. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] ZCE Question
Has someone an clue about this zce question: The following is a common XML structure used in service oriented architectures, what does it represent? myMethod HI! Answer... None of the above A fragment of a complete SOAP request XML-RPC REST SOAP i think the answer is: SOAP some idea? thanks Augusto Morais
[PHP] Re: Convert File Sizes (16M => 16777216)
Never mind, my bad - Looked everywhere except in ini_get documentation. Thanks anyway. On Sat, Aug 8, 2009 at 9:24 PM, דניאל דנון wrote: > Hello all :) > > I have a problem, so, Before I'll start building my own function - I was > wondering - is there any built-in function to convert 16M to 16777216 > (Including all other types of letters)? > (16M = 16 * 1024 * 1024) > > > (Its from php.ini configurations) > > -- > Use ROT26 for best security > -- Use ROT26 for best security
[PHP] Convert File Sizes (16M => 16777216)
Hello all :) I have a problem, so, Before I'll start building my own function - I was wondering - is there any built-in function to convert 16M to 16777216 (Including all other types of letters)? (16M = 16 * 1024 * 1024) (Its from php.ini configurations) -- Use ROT26 for best security
Re: [PHP] php external interfaces
well i know the command shell_exec(), that work like console, just put de command as paramether. More info in php documentation. For COM objects for example, $word = new COM("word.application") or die("Unable to instantiate application object"); $wordDocument = new COM("word.document") or die("Unable to instantiate document object"); $word->Visible = 0; $wordDocument = $word->Documents->Open($DocumentPath); $HTMLPath = substr_replace($DocumentPath, 'txt', -3, 3); $wordDocument->SaveAs($HTMLPath, 3); $wordDocument = null; $word->Quit(); $word = null; this opens a word document and save it as .txt document. there should be more info in the MSDN documentation. 2009/8/8 Robert Cummings > pete123456 wrote: > >> hi, >> im running php on IIS and im trying to evaluate php's capabilities >> regarding >> external interfaces. >> elg. executing .exe, batch files, com objects. is that all possible? does >> anyone have any good reference where i can find out more about this? >> > > .exe and .bat files should work fine, the do for me. Have you tried? I > haven't really done anything with com objects. > > Cheers, > Rob. > -- > http://www.interjinn.com > Application and Templating Framework for PHP > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > >
Re: [PHP] Re: dynamically naming PHP vars on the fly?
On Sat, 8 Aug 2009 16:25:24 +0200, "Ralph Deffke" wrote: > but then ur byond simple select, man, I do hate unions > and try to avoid those. Hear, hear! I'll look into that stuff in my next life, perhaps. /Nisse -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: does array_slice not work on multidimensional arrays?
On Sat, 08 Aug 2009 16:05:20 +0100, Ashley Sheridan wrote: > It is annoying working with arrays sometimes, as some functions work on > the actual array, while others return the results of working on the > array without changing anything. Is there any particular reason for > that? Well in this case [array_slice()], I'd say you most probably want to keep the original array intact. In other cases, such as sort() or array_push(), you really want to modify the array you pass to them. The implementors have probably tried to pick the most reasonable method for each function, and it seems to work out well for me. But I'm only guessing. /Nisse -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: does array_slice not work on multidimensional arrays?
On Sat, 2009-08-08 at 12:18 -0400, Robert Cummings wrote: > John Butler wrote: > >> It is annoying working with arrays sometimes, as some functions work > >> on > >> the actual array, while others return the results of working on the > >> array without changing anything. Is there any particular reason for > >> that? > > > > ...you mean what are the reasons for the different ways the arrays work? > > > > Then you must be asking the list in general (not me ;-)) > > Efficiency is often one of the reasons. Do you really want the overhead > incurred by returning a copy of a 5 member. Most of the sort > functions work on the array itself. > > By working on the array itself, PHP offers you, the programmer, the > choice of incurring the overhead since you can copy it before sorting. > > Cheers, > Rob. > -- > http://www.interjinn.com > Application and Templating Framework for PHP > That makes sense. Thanks, Ash http://www.ashleysheridan.co.uk
Re: [PHP] php external interfaces
pete123456 wrote: hi, im running php on IIS and im trying to evaluate php's capabilities regarding external interfaces. elg. executing .exe, batch files, com objects. is that all possible? does anyone have any good reference where i can find out more about this? .exe and .bat files should work fine, the do for me. Have you tried? I haven't really done anything with com objects. Cheers, Rob. -- http://www.interjinn.com Application and Templating Framework for PHP -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: does array_slice not work on multidimensional arrays?
John Butler wrote: It is annoying working with arrays sometimes, as some functions work on the actual array, while others return the results of working on the array without changing anything. Is there any particular reason for that? ...you mean what are the reasons for the different ways the arrays work? Then you must be asking the list in general (not me ;-)) Efficiency is often one of the reasons. Do you really want the overhead incurred by returning a copy of a 5 member. Most of the sort functions work on the array itself. By working on the array itself, PHP offers you, the programmer, the choice of incurring the overhead since you can copy it before sorting. Cheers, Rob. -- http://www.interjinn.com Application and Templating Framework for PHP -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: does array_slice not work on multidimensional arrays?
It is annoying working with arrays sometimes, as some functions work on the actual array, while others return the results of working on the array without changing anything. Is there any particular reason for that? ...you mean what are the reasons for the different ways the arrays work? Then you must be asking the list in general (not me ;-)) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] php external interfaces
hi, im running php on IIS and im trying to evaluate php's capabilities regarding external interfaces. elg. executing .exe, batch files, com objects. is that all possible? does anyone have any good reference where i can find out more about this? thanks pete -- View this message in context: http://www.nabble.com/php-external-interfaces-tp24877950p24877950.html Sent from the PHP - General mailing list archive at Nabble.com. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Server change affecting ability to send downloaded files???
http://us2.php.net/readfile Returns the number of bytes read from the file. If an error occurs, FALSE is > returned and unless the function was called as @readfile(), an error message > is printed. Ah. So readfile() was generating some error and outputting before the Content-Type was sent to the browser. It might not hurt to move to a fread($fh, 8096) + print() to prevent the bug in the future. Jerry Wilborn jerrywilb...@gmail.com On Sat, Aug 8, 2009 at 9:00 AM, Brian Dunning wrote: > A Rackspace guy determined that php.ini was set to use 16MB of memory, and > he upped it to 32MB, and now everything works. Some of my downloads are as > large as 41MB so I asked him to up it to 48MB. > > Maybe they upgraded the PHP version or something and wiped this setting. > The 41MB files had always been downloading to customers before, without any > problem -- is there some way that could have worked with php.ini set to > 16MB, or does this mean for sure that the setting was changed somehow? > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > >
Re: [PHP] Can php be cause a strain on a web server
On Sat, 2009-08-08 at 10:08 -0500, Jerry Wilborn wrote: > You're going to have to be more > specific. There are very few problems where this is absolutely no solution. > > Jerry Wilborn > jerrywilb...@gmail.com > > > On Sat, Aug 8, 2009 at 2:51 AM, Per Jessen wrote: > > > Curious george wrote: > > > > > Is there a case where php can become unscalable for a web sever ? If > > > so can anyone please state to me how... Thanks > > > George > > > > Yes, any inappropriately designed application can be unscalable wherever > > it runs. > > > > > > /Per > > > > -- > > Per Jessen, Zürich (21.6°C) > > > > > > -- > > PHP General Mailing List (http://www.php.net/) > > To unsubscribe, visit: http://www.php.net/unsub.php > > > > He only said it 'can be' not 'is', so yeah, if you design an app so badly, there is a chance you've designed it in such a way that you can't scale it. Like you said yourself, there are few cases where this will happen, but in those few cases, is it not likely that bad design was at least part of why it can't be scaled? Thanks, Ash http://www.ashleysheridan.co.uk -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Can php be cause a strain on a web server
You're going to have to be more specific. There are very few problems where this is absolutely no solution. Jerry Wilborn jerrywilb...@gmail.com On Sat, Aug 8, 2009 at 2:51 AM, Per Jessen wrote: > Curious george wrote: > > > Is there a case where php can become unscalable for a web sever ? If > > so can anyone please state to me how... Thanks > > George > > Yes, any inappropriately designed application can be unscalable wherever > it runs. > > > /Per > > -- > Per Jessen, Zürich (21.6°C) > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > >
Re: [PHP] Notification system
I highly recommend ExtJS (htp://www.extjs.com). Jerry Wilborn jerrywilb...@gmail.com On Fri, Aug 7, 2009 at 10:22 PM, Bastien Koert wrote: > On Fri, Aug 7, 2009 at 10:25 PM, Jonathan Tapicer > wrote: > > Also, take a look at Comet Server: > > http://en.wikipedia.org/wiki/Comet_(programming) > > > > I think that Facebook uses that and also Gmail, it tends to consume > > less resources than periodical ajax calls, the hidden iframe method is > > simple and works fine. To implement it in PHP you will need to use the > > flush function to send data a continue processing/polling. > > > > Regards, > > > > Jonathan > > > > 2009/8/7 Phpster : > >> > >> > >> > >> > >> On Aug 2, 2009, at 7:59 AM, Dušan Novaković wrote: > >> > >>> Hi, > >>> > >>> Does anyone has any idea how to create notification system with > >>> combination of php, mysql and javascript. It should be something > >>> similar to facebook notification system (when someone make some action > >>> it should be automatically reported to other people on system through > >>> pop-up menu or something like that). I just need some basic idea how > >>> to start or if someone has some example it would be perfect. > >>> > >>> Thanks, > >>> Dusan > >>> > >>> -- made by Dusan > >>> > >>> -- PHP General Mailing List (http://www.php.net/) > >>> To unsubscribe, visit: http://www.php.net/unsub.php > >>> > >> > >> I think you could have some kind if Ajax polling of a php function. To > keep > >> the traffic down you could set it to poll once a minute or every 30 > seconds > >> or so. Send a simple XML stream that could feed a defined JavaScript > >> function or a bit of xslt for display. > >> > >> > >> Bastien > >> > >> Sent from my iPod > >> -- > >> PHP General Mailing List (http://www.php.net/) > >> To unsubscribe, visit: http://www.php.net/unsub.php > >> > >> > > > > http://www.infoq.com/news/2008/05/facebookchatarchitecture is an > interesting blog on how they do it > > -- > > Bastien > > Cat, the other other white meat > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > >
Re: [PHP] Re: does array_slice not work on multidimensional arrays?
On Sat, 2009-08-08 at 09:00 -0600, John Butler wrote: > >> It seems clear to me, but do you also agree that my evidence is that > >> array_slice() does NOT work on multi-dimmed arrays on v.4.3.9? > >> Here is the evidence: > >> > >> this: > >> > >> var_dump($BuildPerUniqueDateArray); > >> echo"\n\n~\n\n"; > >> array_slice($BuildPerUniqueDateArray, 1, 2); > >> var_dump($BuildPerUniqueDateArray); > > > > It seems clear to me that you are dumping /the same/ > > array twice. > > > Aha. I see now. I had to *assign* the results of the array_slice > to a [new] array and then use that ... > (trying to do something and expecting the results to "stick" even > without assigning them to a var, bites me every week or so. I'll get > it through my old habits-from-other-languages skull eventually.) > > Thank you Nisse, > > -Govinda > It is annoying working with arrays sometimes, as some functions work on the actual array, while others return the results of working on the array without changing anything. Is there any particular reason for that? Thanks, Ash http://www.ashleysheridan.co.uk -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: does array_slice not work on multidimensional arrays?
It seems clear to me, but do you also agree that my evidence is that array_slice() does NOT work on multi-dimmed arrays on v.4.3.9? Here is the evidence: this: var_dump($BuildPerUniqueDateArray); echo"\n\n~\n\n"; array_slice($BuildPerUniqueDateArray, 1, 2); var_dump($BuildPerUniqueDateArray); It seems clear to me that you are dumping /the same/ array twice. Aha. I see now. I had to *assign* the results of the array_slice to a [new] array and then use that ... (trying to do something and expecting the results to "stick" even without assigning them to a var, bites me every week or so. I'll get it through my old habits-from-other-languages skull eventually.) Thank you Nisse, -Govinda -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: does array_slice not work on multidimensional arrays?
On Sat, 8 Aug 2009 08:29:36 -0600, John Butler wrote: > It seems clear to me, but do you also agree that my evidence is that > array_slice() does NOT work on multi-dimmed arrays on v.4.3.9? > Here is the evidence: > > this: > > var_dump($BuildPerUniqueDateArray); > echo"\n\n~\n\n"; > array_slice($BuildPerUniqueDateArray, 1, 2); > var_dump($BuildPerUniqueDateArray); It seems clear to me that you are dumping /the same/ array twice. /Nisse -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: does array_slice not work on multidimensional arrays?
does array_slice not work on multidimensional arrays? I have one multidimensional array, and when I run it thru' array_slice() nothing happens, that I can tell. If it does not work on multidimensional arrays, what is the *simplest* workaround? (I am already working past what was budgeted for this this script.. so I really want to avoid anything but the most newbie of hacks to achieve this.) //PHP Version 4.3.9 Works for me in PHP 5: cat a.php $a1 = array (array (1,2,3,4), array ('a','b','c'), array (true, false)); $a2 = array_slice ($a1, 1, 2); var_dump ($a2); php5 a.php 5.2.5 array(2) { [0]=> array(3) { [0]=> string(1) "a" [1]=> string(1) "b" [2]=> string(1) "c" } [1]=> array(2) { [0]=> bool(true) [1]=> bool(false) } } It seems clear to me, but do you also agree that my evidence is that array_slice() does NOT work on multi-dimmed arrays on v.4.3.9? Here is the evidence: this: var_dump($BuildPerUniqueDateArray); echo"\n\n~\n\n"; array_slice($BuildPerUniqueDateArray, 1, 2); var_dump($BuildPerUniqueDateArray); returns: array(12) { ["2009-08-08"]=> array(2) { ["t7solar_landing"]=> string(1) "2" ["aweber_7solar_aw"]=> string(1) "1" } ["2009-08-07"]=> array(3) { ["t7solar_landing"]=> string(1) "2" ["aweber_7solar_aw"]=> string(1) "1" ["aweber_7solar_confirm"]=> string(1) "1" } ["2009-08-06"]=> array(3) { ["aweber_7solar_confirm"]=> string(1) "5" ["t7solar_landing"]=> string(1) "6" ["aweber_7solar_aw"]=> string(1) "3" } ["2009-08-05"]=> array(3) { ["aweber_7solar_confirm"]=> string(1) "1" ["t7solar_landing"]=> string(1) "3" ["aweber_7solar_aw"]=> string(1) "4" } ... ~ array(12) { ["2009-08-08"]=> array(2) { ["t7solar_landing"]=> string(1) "2" ["aweber_7solar_aw"]=> string(1) "1" } ["2009-08-07"]=> array(3) { ["t7solar_landing"]=> string(1) "2" ["aweber_7solar_aw"]=> string(1) "1" ["aweber_7solar_confirm"]=> string(1) "1" } ["2009-08-06"]=> array(3) { ["aweber_7solar_confirm"]=> string(1) "5" ["t7solar_landing"]=> string(1) "6" ["aweber_7solar_aw"]=> string(1) "3" } ["2009-08-05"]=> array(3) { ["aweber_7solar_confirm"]=> string(1) "1" ["t7solar_landing"]=> string(1) "3" ["aweber_7solar_aw"]=> string(1) "4" } ... John Butler (Govinda) govinda.webdnat...@gmail.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: dynamically naming PHP vars on the fly?
but then ur byond simple select, man, I do hate unions and try to avoid those. "Nisse Engström" wrote in message news:8b.50.40613.c518d...@pb1.pair.com... > On Sat, 8 Aug 2009 15:01:42 +0200, "Ralph Deffke" wrote: > > > of course u can do this by sql. > > > > see this > > SELECT * > > FROM `sometable` > > LIMIT 0 , 30 > > > > gives u max 30 records if existstarting at record 0 > > > > on the next request u could say > > SELECT * > > FROM `sometable` > > LIMIT 30 , 30 > > > > giving u max 30 recotds starting at record 30 > > Yup. I do that a lot. But the original problem was > about a UNION of three tables. That's when my head > go dizzy. (And that's not because of the bottle of > Guinness I just had for lunch). > > > /Nisse -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Server change affecting ability to send downloaded files???
A Rackspace guy determined that php.ini was set to use 16MB of memory, and he upped it to 32MB, and now everything works. Some of my downloads are as large as 41MB so I asked him to up it to 48MB. Maybe they upgraded the PHP version or something and wiped this setting. The 41MB files had always been downloading to customers before, without any problem -- is there some way that could have worked with php.ini set to 16MB, or does this mean for sure that the setting was changed somehow? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: dynamically naming PHP vars on the fly?
On Sat, 8 Aug 2009 15:01:42 +0200, "Ralph Deffke" wrote: > of course u can do this by sql. > > see this > SELECT * > FROM `sometable` > LIMIT 0 , 30 > > gives u max 30 records if existstarting at record 0 > > on the next request u could say > SELECT * > FROM `sometable` > LIMIT 30 , 30 > > giving u max 30 recotds starting at record 30 Yup. I do that a lot. But the original problem was about a UNION of three tables. That's when my head go dizzy. (And that's not because of the bottle of Guinness I just had for lunch). /Nisse -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: does array_slice not work on multidimensional arrays?
On Fri, 7 Aug 2009 17:06:45 -0600, John Butler wrote: > does array_slice not work on multidimensional arrays? > > I have one multidimensional array, and when I run it thru' > array_slice() nothing happens, that I can tell. > > If it does not work on multidimensional arrays, what is the *simplest* > workaround? (I am already working past what was budgeted for this > this script.. so I really want to avoid anything but the most newbie > of hacks to achieve this.) > > //PHP Version 4.3.9 Works for me in PHP 5: >cat a.php php5 a.php 5.2.5 array(2) { [0]=> array(3) { [0]=> string(1) "a" [1]=> string(1) "b" [2]=> string(1) "c" } [1]=> array(2) { [0]=> bool(true) [1]=> bool(false) } } When I first looked into array_slice, I was hoping that it could be used to extract a "column" from a multi-dimensional array, e.g.: array_slice ($a1, 1) would result in: array (2, 'b', false) This would be very useful at times, but doesn't seem to be possible. /Nisse -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: dynamically naming PHP vars on the fly?
of course u can do this by sql. see this SELECT * FROM `sometable` LIMIT 0 , 30 gives u max 30 records if existstarting at record 0 on the next request u could say SELECT * FROM `sometable` LIMIT 30 , 30 giving u max 30 recotds starting at record 30 ralph ralph_def...@yahoo.de "Nisse Engström" wrote in message news:eb.35.03345.5f47d...@pb1.pair.com... > On Thu, 6 Aug 2009 12:42:49 -0600, Govinda wrote: > > >> Others have mentioned variable variables. While I have > >> used those, I tend to prefer arrays: > > > > ah, yes, I see that too, now. Thanks for reminding me about arrays. > > (You must be quite adept at arrays. ) > > I don't know, but I often stuff things into array, > such as the following snippet: > > ... while ($r = mysql_fetch_row ($res)) { > $news_paged[$page][$r[0]]['short_desc'] = $r[1]; > if (isset ($r[2])) > $news_paged[$page][$r[0]]['long_desc'] = $r[2]; > ... > > > I wonder if there's a noticable difference in performance > between variable variables and arrays... I'm guessing it's > small enough to be of no concern. > > > (And to give you credit Nisse, I ended up going with your solution > > ('knock on wood'.. it is not all done yet) from the other php-db list > > (building an array from data returned from the 3 union all selects- > > query).) > > I'm a total newbie when it comes to SQL beyond simple SELECTs. > If there's a noticable gain to be made from limiting the number > of rows returned from the database, then that is probably worth > persuing. Otherwise, I'd do it in PHP. > > > /Nisse -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: dynamically naming PHP vars on the fly?
On Thu, 6 Aug 2009 12:42:49 -0600, Govinda wrote: >> Others have mentioned variable variables. While I have >> used those, I tend to prefer arrays: > > ah, yes, I see that too, now. Thanks for reminding me about arrays. > (You must be quite adept at arrays. ) I don't know, but I often stuff things into array, such as the following snippet: ... while ($r = mysql_fetch_row ($res)) { $news_paged[$page][$r[0]]['short_desc'] = $r[1]; if (isset ($r[2])) $news_paged[$page][$r[0]]['long_desc'] = $r[2]; ... I wonder if there's a noticable difference in performance between variable variables and arrays... I'm guessing it's small enough to be of no concern. > (And to give you credit Nisse, I ended up going with your solution > ('knock on wood'.. it is not all done yet) from the other php-db list > (building an array from data returned from the 3 union all selects- > query).) I'm a total newbie when it comes to SQL beyond simple SELECTs. If there's a noticable gain to be made from limiting the number of rows returned from the database, then that is probably worth persuing. Otherwise, I'd do it in PHP. /Nisse -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: PHP programming strategy
On Sat, 2009-08-08 at 07:53 -0400, tedd wrote: > At 6:32 AM +0100 8/7/09, Ashley Sheridan wrote: > > > > > > >> > >> > >> > >>Yanni Nx > >>Sally Riordan Scholarship, 2007- > >> > >> > >> > >> > >> (And the thing that really astounds me about CSS is that they > >>never thought of putting in > >> constants. Instead of being able to specify a set of colours, and > >>then simply quote them > >> in the CSS whenever they are needed, I have to specify them in > >>PHP, and then encode them > >> into the CSS every time I use them, which is a real pain in the > >>. The total lack of > >> diagnostics is another real pain.) > >> > >> > >Well, your above example would just become: > > > > > > > > Yanni Nx > > Sally Riordan Scholarship, 2007- > > > > Ash: > > You don't need the width="210" height="300". For example, this works: > > > > Yanni Nx > Sally Riordan Scholarship, 2007- > > > Also, if you use first-child, it could be taken down to: > > > > Yanni Nx > Sally Riordan Scholarship, 2007- > > > Cheers, > > tedd > -- > --- > http://sperling.com http://ancientstones.com http://earthstones.com > FirstChild isn't as widely supported yet (IE again :( ), so I'm still not using it, but yes, I could have got rid of the dimension attributes too! To Clancy, it was only a guess that put your title with the image. The alt attribute is used to ensure that the text label is implicitly associated with your image. What if your image was actually replacing text as a stylised heading? Without the alt attribute, there is no way to determine what the image is for. Thanks, Ash http://www.ashleysheridan.co.uk -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: PHP programming strategy
At 6:32 AM +0100 8/7/09, Ashley Sheridan wrote: > Yanni Nx Sally Riordan Scholarship, 2007- (And the thing that really astounds me about CSS is that they never thought of putting in constants. Instead of being able to specify a set of colours, and then simply quote them in the CSS whenever they are needed, I have to specify them in PHP, and then encode them into the CSS every time I use them, which is a real pain in the . The total lack of diagnostics is another real pain.) Well, your above example would just become: Yanni Nx Sally Riordan Scholarship, 2007- Ash: You don't need the width="210" height="300". For example, this works: Yanni Nx Sally Riordan Scholarship, 2007- Also, if you use first-child, it could be taken down to: Yanni Nx Sally Riordan Scholarship, 2007- Cheers, tedd -- --- http://sperling.com http://ancientstones.com http://earthstones.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: "PHP 6 and MySQL 5 for Dynamic Web Sites" Book
At 10:11 PM -0400 8/6/09, Larry Ullman wrote: -snip- Sorry for the length, but I hope that helps. And thanks again. Larry Larry: No, thank you for your most excellent books -- I think I've purchased every one one you've written. They have helped me. Cheers, tedd -- --- http://sperling.com http://ancientstones.com http://earthstones.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] str_replace
Yes I did. Thank you for confirming this with me. Ron - Original Message - From: "LinuxManMikeC" To: "Ron Piggott" Cc: ; Sent: Saturday, August 08, 2009 6:19 AM Subject: Re: [PHP] str_replace On Sat, Aug 8, 2009 at 2:08 AM, Ron Piggott wrote: Am I understanding str_replace correctly? Do I have this correct or are ' needed? $bible_verse_ref is what I want to change to (AKA replace) bible_verse_ref is what I change to change from (AKA search) $text_message_template is the string I want to manipulate $text_message = str_replace( $bible_verse_ref, 'bible_verse_ref', $text_message_template ); Ron If I understand you right, I think you have the search and replace arguments mixed up. Your current code will look for all occurrences of $bible_verse_ref in $text_message_template and replace it with 'bible_verse_ref'. http://us.php.net/manual/en/function.str-replace.php No virus found in this incoming message. Checked by AVG - www.avg.com Version: 8.5.392 / Virus Database: 270.13.47/2289 - Release Date: 08/07/09 18:37:00 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] str_replace
On Sat, Aug 8, 2009 at 2:08 AM, Ron Piggott wrote: > Am I understanding str_replace correctly? Do I have this correct or are ' > needed? > > $bible_verse_ref is what I want to change to (AKA replace) > bible_verse_ref is what I change to change from (AKA search) > $text_message_template is the string I want to manipulate > > $text_message = str_replace( $bible_verse_ref, 'bible_verse_ref', > $text_message_template ); > > Ron If I understand you right, I think you have the search and replace arguments mixed up. Your current code will look for all occurrences of $bible_verse_ref in $text_message_template and replace it with 'bible_verse_ref'. http://us.php.net/manual/en/function.str-replace.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: str_replace
looks good, u r searching for $bible_verse_ref in $text_message_template to be replaced by the string "bible_verse_ref". if that makes sence to u, yes its right. ralph ralph_def...@yahoo.de ""Ron Piggott"" wrote in message news:83745b9e385a4402888ba5924c296...@computera1afe9... Am I understanding str_replace correctly? Do I have this correct or are ' needed? $bible_verse_ref is what I want to change to (AKA replace) bible_verse_ref is what I change to change from (AKA search) $text_message_template is the string I want to manipulate $text_message = str_replace( $bible_verse_ref, 'bible_verse_ref', $text_message_template ); Ron -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Undefined symbol "ssl_onceonlyinit"
2009/8/8 Adam Randall > I wonder if it's downloading the imap.so as a binary instead of source > (or php as a binary instead of source). But this is the reason you are > getting the errors. It has to do with the shared libraries at build > time not matching the shared libraries at runtime (eg the symbol in > the shared library I'm expecting is not in the shared library I am > using). > > You know, looking at the error messages that you posted again I now > realize that the incompatability is not between imap and php, but imap > and /libexec/ld-elf.so.1. That's where you need to look it seems. > Im not that experienced that i know what do to with that!? :-( > > Adam. > > On Sat, Aug 8, 2009 at 1:34 AM, Ebbe Hjorth wrote: > > Hi, > > > > Sounds like mac ports and freebsd ports i kinda the same. > > > > I tried deinstalling the extensions ports, and reinstalling it, meaning > it > > all gets build from source once more, and it didnt help. > > > > > > / Ebbe > > > > 2009/8/8 Adam Randall > >> > >> While I haven't used FreeBSD, the message you are getting basically > >> means that when the imap.so was built it was against a different, > >> incompatible version of PHP. I'm going to assume that the freebsd > >> ports is related to my Mac Ports, which I think is based off it. If > >> that's true, then ports is downloading and building PHP from source. > >> If the imap.so was downloaded as a binary, or not rebuilt when php was > >> last built, you will get this symbol mismatch. If possible, rebuild > >> imap from source against your currently installed PHP and that should > >> resolve it for you. > >> > >> Adam. > >> > >> On Sat, Aug 8, 2009 at 1:06 AM, Ebbe Hjorth > wrote: > >> > Hi, > >> > > >> > I just installed FreeBSD 7.2, Apache 2.2, php5-5.2.10 and > >> > php5-extensions > >> > 1.3, all from the freebsd ports. > >> > > >> > When i try to start apache with the imap.so extension enabled in > >> > extensions.ini, i get the error > >> > /libexec/ld-elf.so.1: /usr/local/lib/php/20060613/imap.so: Undefined > >> > symbol > >> > "ssl_onceonlyinit" > >> > > >> > I tried to google it, but all i get is an old bug from 2002. > >> > > >> > Please help ;) > >> > > >> > Thanks, Ebbe, Denmark > >> > > >> > >> > >> > >> -- > >> Adam Randall > >> http://www.xaren.net > >> AIM: blitz574 > > > > > > > > -- > Adam Randall > http://www.xaren.net > AIM: blitz574 >
Re: [PHP] Undefined symbol "ssl_onceonlyinit"
I wonder if it's downloading the imap.so as a binary instead of source (or php as a binary instead of source). But this is the reason you are getting the errors. It has to do with the shared libraries at build time not matching the shared libraries at runtime (eg the symbol in the shared library I'm expecting is not in the shared library I am using). You know, looking at the error messages that you posted again I now realize that the incompatability is not between imap and php, but imap and /libexec/ld-elf.so.1. That's where you need to look it seems. Adam. On Sat, Aug 8, 2009 at 1:34 AM, Ebbe Hjorth wrote: > Hi, > > Sounds like mac ports and freebsd ports i kinda the same. > > I tried deinstalling the extensions ports, and reinstalling it, meaning it > all gets build from source once more, and it didnt help. > > > / Ebbe > > 2009/8/8 Adam Randall >> >> While I haven't used FreeBSD, the message you are getting basically >> means that when the imap.so was built it was against a different, >> incompatible version of PHP. I'm going to assume that the freebsd >> ports is related to my Mac Ports, which I think is based off it. If >> that's true, then ports is downloading and building PHP from source. >> If the imap.so was downloaded as a binary, or not rebuilt when php was >> last built, you will get this symbol mismatch. If possible, rebuild >> imap from source against your currently installed PHP and that should >> resolve it for you. >> >> Adam. >> >> On Sat, Aug 8, 2009 at 1:06 AM, Ebbe Hjorth wrote: >> > Hi, >> > >> > I just installed FreeBSD 7.2, Apache 2.2, php5-5.2.10 and >> > php5-extensions >> > 1.3, all from the freebsd ports. >> > >> > When i try to start apache with the imap.so extension enabled in >> > extensions.ini, i get the error >> > /libexec/ld-elf.so.1: /usr/local/lib/php/20060613/imap.so: Undefined >> > symbol >> > "ssl_onceonlyinit" >> > >> > I tried to google it, but all i get is an old bug from 2002. >> > >> > Please help ;) >> > >> > Thanks, Ebbe, Denmark >> > >> >> >> >> -- >> Adam Randall >> http://www.xaren.net >> AIM: blitz574 > > -- Adam Randall http://www.xaren.net AIM: blitz574 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Undefined symbol "ssl_onceonlyinit"
Hi, Sounds like mac ports and freebsd ports i kinda the same. I tried deinstalling the extensions ports, and reinstalling it, meaning it all gets build from source once more, and it didnt help. / Ebbe 2009/8/8 Adam Randall > While I haven't used FreeBSD, the message you are getting basically > means that when the imap.so was built it was against a different, > incompatible version of PHP. I'm going to assume that the freebsd > ports is related to my Mac Ports, which I think is based off it. If > that's true, then ports is downloading and building PHP from source. > If the imap.so was downloaded as a binary, or not rebuilt when php was > last built, you will get this symbol mismatch. If possible, rebuild > imap from source against your currently installed PHP and that should > resolve it for you. > > Adam. > > On Sat, Aug 8, 2009 at 1:06 AM, Ebbe Hjorth wrote: > > Hi, > > > > I just installed FreeBSD 7.2, Apache 2.2, php5-5.2.10 and php5-extensions > > 1.3, all from the freebsd ports. > > > > When i try to start apache with the imap.so extension enabled in > > extensions.ini, i get the error > > /libexec/ld-elf.so.1: /usr/local/lib/php/20060613/imap.so: Undefined > symbol > > "ssl_onceonlyinit" > > > > I tried to google it, but all i get is an old bug from 2002. > > > > Please help ;) > > > > Thanks, Ebbe, Denmark > > > > > > -- > Adam Randall > http://www.xaren.net > AIM: blitz574 >
Re: [PHP] Can php be cause a strain on a web server
Curious george wrote: > Is there a case where php can become unscalable for a web sever ? If > so can anyone please state to me how... Thanks > George Yes, any inappropriately designed application can be unscalable wherever it runs. /Per -- Per Jessen, Zürich (21.6°C) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] str_replace
Am I understanding str_replace correctly? Do I have this correct or are ' needed? $bible_verse_ref is what I want to change to (AKA replace) bible_verse_ref is what I change to change from (AKA search) $text_message_template is the string I want to manipulate $text_message = str_replace( $bible_verse_ref, 'bible_verse_ref', $text_message_template ); Ron
[PHP] Undefined symbol "ssl_onceonlyinit"
Hi, I just installed FreeBSD 7.2, Apache 2.2, php5-5.2.10 and php5-extensions 1.3, all from the freebsd ports. When i try to start apache with the imap.so extension enabled in extensions.ini, i get the error /libexec/ld-elf.so.1: /usr/local/lib/php/20060613/imap.so: Undefined symbol "ssl_onceonlyinit" I tried to google it, but all i get is an old bug from 2002. Please help ;) Thanks, Ebbe, Denmark