[PHP] What can cause session_destroy to fail?

2007-06-11 Thread Mattias Thorslund
Hi, One of my clients just received a PHP warning that session_destroy() failed. Using the default session handler (with tmp files), what are the most likely things that can cause session_destroy() to return false? Thanks for any suggestions. Mattias -- PHP General Mailing List

Re: [PHP] What can cause session_destroy to fail?

2007-06-12 Thread Mattias Thorslund
Jim Lucas wrote: Mattias Thorslund wrote: Hi, One of my clients just received a PHP warning that session_destroy() failed. Using the default session handler (with tmp files), what are the most likely things that can cause session_destroy() to return false? Thanks for any suggestions

Re: [PHP] What can cause session_destroy to fail?

2007-06-12 Thread Mattias Thorslund
Jim Lucas wrote: Mattias Thorslund wrote: Jim Lucas wrote: Mattias Thorslund wrote: Hi, One of my clients just received a PHP warning that session_destroy() failed. Using the default session handler (with tmp files), what are the most likely things that can cause session_destroy

Re: [PHP] What can cause session_destroy to fail? -- thanks!

2007-06-12 Thread Mattias Thorslund
Richard Lynch wrote: On Mon, June 11, 2007 8:36 pm, Mattias Thorslund wrote: One of my clients just received a PHP warning that session_destroy() failed. Using the default session handler (with tmp files), what are the most likely things that can cause session_destroy() to return false

[PHP] mnoGoSearch and similar

2008-05-21 Thread Mattias Thorslund
Hi, I'm looking at possibly implementing mnoGoSearch (for indexing and search of uploaded documents on the server) into my application, but noticed it has been moved into PECL since PHP 5.1. Does this mean mnoGoSearch has been deprecated and there is a different/better solution that I should

Re: [PHP] mnoGoSearch and similar

2008-05-21 Thread Mattias Thorslund
Dmitri wrote: Mattias Thorslund wrote: Hi, I'm looking at possibly implementing mnoGoSearch (for indexing and search of uploaded documents on the server) into my application, but noticed it has been moved into PECL since PHP 5.1. Does this mean mnoGoSearch has been deprecated

[PHP] PHP-CLI and the less command (kubuntu)

2008-07-01 Thread Mattias Thorslund
Hi everyone, I have a CLI application that produces lots of output to the terminal, so I like to send the output along to the less command. This has always worked very nicely. Moving to the top or bottom of the output used to require just hitting the home or end key, and the up and down

Re: [PHP] PHP-CLI and the less command (kubuntu)

2008-07-02 Thread Mattias Thorslund
Stut wrote: On 2 Jul 2008, at 02:58, Mattias Thorslund wrote: Hi everyone, I have a CLI application that produces lots of output to the terminal, so I like to send the output along to the less command. This has always worked very nicely. Moving to the top or bottom of the output used

Re: [PHP] Using MDB2 outside the PEAR framework?

2008-12-26 Thread Mattias Thorslund
As far as I recall, having done this, all that is required for a basic MDB2 is the PEAR base class and the driver classes for the platforms you want to support. Murray wrote: Hi All, I'm wondering if it's possible or practical to implement MDB2 in my web application, but without requiring a

Re: [PHP] Re: hello - thread on topic or not?

2009-01-08 Thread Mattias Thorslund
I thought this was the PHP list, not the OS vs. OS list? Is this type of discussion now considered OK here? I recall people getting flamed for borderline off-topic posts even, just a few years ago. Mattias -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit:

Re: [PHP] About printing functions

2009-01-21 Thread Mattias Thorslund
Thodoris wrote: Hi gang, Lets say that you have a function that prints something to the output simply like this: function print_str() { print blah blah blah; } I was wondering if there is a way to use this output and store it in a var or something without changing the function itself?

Re: [PHP] Re: Global Changes With Loop To Allow Nulls In A Table...

2009-01-27 Thread Mattias Thorslund
Jay Moore wrote: revDAVE wrote: Hi Folks, Newbie question I have a mysql table with 100 fields, currently all do not allow nulls. Rather than hand typing in phpMyAdmin, I would like a way to loop through all fields and update them to allow nulls First I would DESCRIBE the table so

Re: [PHP] Re: verification of mail success

2006-02-23 Thread Mattias Thorslund
Manuel Lemos wrote: Hello, on 02/23/2006 09:22 PM [EMAIL PROTECTED] said the following: This might be too simple or not... I'm trying to send emails from my PHP page, and while both mail() and PEAR Mail work, I'm having a hard time finding out whether a message was actually sent or

Re: [PHP] PHP and CakePHP

2006-03-30 Thread Mattias Thorslund
Pham Huu Le Quoc Phuc wrote: I use CakePHP The folowing code do not execute: td align=center ?=(!empty($info['Employee']['dob'])) ? $datetime-time2str($info['Employee']['dob']) : ? /td Are you sure that $info['Employee']['dob'] isn't actually empty? To see if that's the case,

Re: [PHP] XML Parsing, starting out.

2006-04-29 Thread Mattias Thorslund
[EMAIL PROTECTED] wrote: Hello, 1st msg here so im excited what results i will get :) Im a novice with php parsing and have been able to help myself quite well with what ive needed with xml_parse_into_struct and then echoing the fixed variable names but now im dealing with an xml document

Re: [PHP] Primer for working with arrays

2005-02-09 Thread Mattias Thorslund
Robert Sossomon wrote: I need a really good primer for working with arrays in PHP and with MySQL. I can do what I need to do without them right now, but I would really like to get arrays figured out. The PHP Cookbook (O'Reilly book) has this, both in the Arrays and Databases chapters.

Re: [PHP] Help with a query please - unable to error check!

2005-02-16 Thread Mattias Thorslund
Could it be a quote-escaping problem? It would be easier to tell if you could show us the query and the code you're using. /Mattias Shaun wrote: Hi, I have a problem with a query, I get the following error message: You have an error in your SQL syntax. Check the manual that corresponds to your

Re: [PHP] sentence case

2005-02-23 Thread Mattias Thorslund
Chris W. Parker wrote: Leif Gregory mailto:[EMAIL PROTECTED] on Wednesday, February 23, 2005 10:31 AM said: I'm thinking something like: 1. strtolower() the string 2. explode() on the period 3. Loop through the resulting array a. trim() whitespace on each element b. ucfirst() on each

Re: [PHP] sentence case

2005-02-23 Thread Mattias Thorslund
Leif Gregory wrote: Hello Chris, Wednesday, February 23, 2005, 11:49:32 AM, you wrote: C And on top of that he'll need to convert all 'i' to 'I' because of C step 1. You and Mattias both have valid points. The only other thing I can think of is a regexp that is searching for a period and a space

[suspicious - maybe spam] [PHP] [suspicious - maybe spam] Re: [PHP] 'Insulate' db connection

2005-03-06 Thread Mattias Thorslund
Since you can use fopen, I don't think open_basedir is the problem. Read about open_basedir here: http://us3.php.net/features.safe-mode Maybe the path that you use in the include is wrong? /Mattias Andre Dubuc wrote: Hi, I am trying to 'insulate' my database connection from prying eyes by moving

[suspicious - maybe spam] [PHP] [suspicious - maybe spam] Re: [PHP] Re: Help with dates

2005-03-06 Thread Mattias Thorslund
M. Sokolewicz wrote: well, you can simply use the unix timestamp, since the amount of days / seconds since 0 AD/BC will be a constant (it won't change, trust me), you can simply add it to that, and add a wrapper function to php's time(). You'll be working with VERY big numbers in that case, so

[suspicious - maybe spam] [PHP] [suspicious - maybe spam] Re: Help with dates

2005-03-06 Thread Mattias Thorslund
: Greetings Mr Mattias, I wish it was so simple. Because the dates that may need calculating can be before 1970. THis function I have.. and it's semi-working, but I've noticed irregularities during the conversion. Thanks for your suggestion!! Yours, Kevin Mattias Thorslund [EMAIL PROTECTED] wrote

[suspicious - maybe spam] [PHP] [suspicious - maybe spam] Re: [PHP] Include file

2005-03-30 Thread Mattias Thorslund
double quotes with single quotes. /Mattias Thorslund -- More views at http://www.thorslund.us -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

[suspicious - maybe spam] [PHP] [suspicious - maybe spam] Re: [PHP] Interesting, yet goofy behavior

2005-04-06 Thread Mattias Thorslund
But, Jay: Am I missing something here? It's obvious that the 'bid' parameter will appear in the query string... That's how the form posts it. Yes, you can unset it if you like, but the form will still add it to the URL that it posts to, unless you change the action attribute of the form tag.

Re: [PHP] Interesting, yet goofy behavior

2005-04-06 Thread Mattias Thorslund
Jay Blanchard wrote: [snip] Am I missing something here? It's obvious that the 'bid' parameter will appear in the query string... That's how the form posts it. Yes, you can unset it if you like, but the form will still add it to the URL that it posts to, unless you change the action attribute of

Re: [PHP] SQL ternary thing

2005-04-06 Thread Mattias Thorslund
Rory Browne wrote: Hi I appreciate this is an SQL issue, more than a PHP issue, but since it isn't a DB specific issue, and I'm planning on using it with PHP(and I'm not subscribed to any SQL lists), I thought I'd post it here. I have a table a bit like the following: create table thing (name

[suspicious - maybe spam] [PHP] [suspicious - maybe spam] Re: [PHP] How do I get the first element's key of an array of objects?

2005-04-07 Thread Mattias Thorslund
Chris W. Parker wrote: While looking through the array functions I saw www.php.net/array_keys and thought of: ?php $keys = array_keys($object_array); $first_key = $keys[0]; ? I wonder if that will work, when the first element has the key 3... ? This might work better: $keys =

[suspicious - maybe spam] [PHP] [suspicious - maybe spam] Re: [PHP] How do I get the first element's key of an array of objects?

2005-04-08 Thread Mattias Thorslund
Chris W. Parker wrote: Read www.php.net/array_keys and you shall have your answer. From the php docs: ?php $array = array(0 = 100, color = red); print_r(array_keys($array)); ? Will output. Array ( [0] = 0 [1] = color ) Duh! Yes, I replied a little too fast on that one. /Mattias --

Re: [PHP] Date class

2005-04-19 Thread Mattias Thorslund
Devraj Mukherjee wrote: Everyone, Do you know of any decent Date/Time handling classes? We require the following functionality 1. Date's prior to 1970 handled (not reliant on the PHP date) 2. add/subtract days to/from a date 3. subtract two dates returning number of days Any pointers are

Re: [PHP] Links exchange with http://php-faq.com. OT - SPAM

2005-04-19 Thread Mattias Thorslund
Ann Clark wrote: Hello, We would like to exchange links between your site http://php-faq.com and our new exciting casino web site. Our site do NOT offer online gambling, it have information about different aspects of gambling and so it's very good and informative from our point of view. We

[suspicious - maybe spam] [PHP] [suspicious - maybe spam] Re: [PHP] Unexpected T_IF

2005-04-25 Thread Mattias Thorslund
ztuni ztuni wrote: I'm experiencing an unexpected T_IF error, and after digging through miles of code, came up empty. The relevant code, along with the if statement Parse error: parse error, unexpected T_IF in /var/www/html/phpBB2/posting.php on line 562 if ( !($result = $db-sql_query($sql)) )

Re: [PHP] Templating engines

2005-04-28 Thread Mattias Thorslund
(On the subject of templating engines, again.) I wonder what you folks think of the following: http://www.massassi.com/php/articles/template_engines/ I've been using the template class in the example of the article. I think it's easy to use and very flexible, since it uses PHP as the actual

Re: [PHP] Templating engines

2005-04-29 Thread Mattias Thorslund
rush wrote: Mattias Thorslund [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] (On the subject of templating engines, again.) I wonder what you folks think of the following: http://www.massassi.com/php/articles/template_engines/ hi! It is nicely written, but actually, I think

Re: [PHP] Re: Templating engines

2005-04-29 Thread Mattias Thorslund
Skrol 29 wrote: What templating engines do you use with php and why? Ive been using smarty (http://smarty.php.net) Clive. I just can't work with PHP the usual way. Mixing business source and interface source is something too bastard for me. Now that I know templates systems I totaly disagree to

Re: [PHP] Re: Templating engines

2005-04-29 Thread Mattias Thorslund
Richard Lynch wrote: Who says PHP itself is a template engine? I do. More importantly, Rasmus does. What? My li'l brother does PHP? Or you mean him Lerdorf? Sorry... /Mattias -- More views at http://www.thorslund.us

Re: [PHP] Re: Templating engines

2005-04-29 Thread Mattias Thorslund
Jason Barnett wrote: Mattias Thorslund wrote: ... Who says PHP itself is a template engine? I think nobody. What are the basic template features? Variables / placeholders Looping construct(s) Conditionals A way to apply styles to text / markup So I suppose I'm just confused over what

Re: [PHP] Re: Templating engines

2005-04-29 Thread Mattias Thorslund
Rasmus Lerdorf wrote: Mattias Thorslund wrote: Who says PHP itself is a template engine? I think nobody. I do. It comes down to whether you want the delineation between the template and the business logic enforced by the system or not. PHP is a general-purpose templating system that does

[Fwd: [PHP] Search MySQL and Match Whole Words]

2004-04-22 Thread Mattias Thorslund
You mean Full-text searches? Read about them here: http://dev.mysql.com/doc/mysql/en/Fulltext_Search.html Only works with certain table types. Not InnoDB tables (transactional) for instance. Best, Mattias (ps new to this list - messed up on replying first time) Original Message

Re: [PHP] Scripting practices

2004-04-23 Thread Mattias Thorslund
I use precisely what you suggest. If you later find out you'd like to wrap a few lines inside a loop, this avoids a potential bug when a variable is not reset to the initial value for each iteration. On Fri, 2004-04-23 at 13:55, Gabe wrote: When scripting in a language (such as PHP) that

Re: [PHP] re-keying an array

2004-04-30 Thread Mattias Thorslund
Just a quick follow-up question on that: Curt Zirzow wrote: foreach(array_slice($filenames, 0, 2) as $filename) { $files[] = path/to/ . $filelname; } Will a function (such as the array_slice here) in a foreach statement get re-evaluated for each iteration, or is it evaluated just once? In

[PHP] include_once changed behavior?

2004-06-07 Thread Mattias Thorslund
Hi, In order to keep configuration files outside the web root I use: include_once('../config.php'); This used to work also when running php scripts from the command line. Now I have a new server and I get no such file or directory when using this construct from the command line. I have worked

Re: [PHP] include_once changed behavior?

2004-06-07 Thread Mattias Thorslund
Jason Wong wrote: On Tuesday 08 June 2004 03:21, Mattias Thorslund wrote: In order to keep configuration files outside the web root I use: include_once('../config.php'); This used to work also when running php scripts from the command line. Now I have a new server and I get no such file

Re: [PHP] Update problem

2004-06-07 Thread Mattias Thorslund
That will work, but the below is really supposed to work. I use it in my apps. Blake Schroeder wrote: Put a hidden field in your form named id. -Blake Mattias Thorslund wrote: Probably with form method=post action=foo.php?id=123 Blake Schroeder wrote: The form that is being submitted can only

Re: [PHP] include_once changed behavior?

2004-06-07 Thread Mattias Thorslund
Marek Kilimajer wrote: cli php uses path relative to your current directory, cgi php uses path relative to the executing script. That IS interesting. That would explain why: php /var/www/myproject/util/my-cli-script.php ... will break unless I execute it from that same directory. I used to be

Re: [PHP] Update problem

2004-06-07 Thread Mattias Thorslund
To reply to the original post (sorry for the confusion): Maldiv wrote: Hello, I have a php update form which use $_POST and $_GET too. I call the update like this update.php?id=1 And after the user submit the form with new data I use command like this: UPDATE table SET id=$_POST['id'] WHERE

Re: [PHP] include_once changed behavior?

2004-06-07 Thread Mattias Thorslund
Jason Wong wrote: Possibly: manual Using PHP from the command line -c switch From the manual: The CLI SAPI does not change the current directory to the directory of the executed script! Note: The CGI SAPI supports the CLI SAPI behaviour by means of the -C switch when run from the command

Re: [PHP] Form Validation

2004-10-13 Thread Mattias Thorslund
There are several JavaScript solutions for validating forms on the client side. Search on hotscripts.com and google.com. Client-side validation (in the browser) is useful, but you shouldn't depend on it to guarantee that the data that your users submit is valid. You should also validate the

Re: [PHP] strange in MySQL Query.

2005-01-15 Thread Mattias Thorslund
... I dont know why .. is this mysql bug ? It's a known bug in MySQL. Since this is a PHP list, I leave it up to you to check what version fixed it. IIRC, it's possible to work around by making sure the first statement has the longest data type. -- More views at http://www.thorslund.us -- PHP

[PHP] Hierarchies and MySQL with PHP

2004-06-27 Thread Mattias Thorslund
Hi, I wonder what you think are the best (or least worst) strategies to store and retrieve hierarchial data (such as a threaded discussion or a multi-level menu tree) in MySQL using PHP? I have been using table structures where each row contains a parent reference, such as: Table Example:

Re: [PHP] Hierarchies and MySQL with PHP

2004-06-27 Thread Mattias Thorslund
Marek Kilimajer wrote: This should be of your interest: http://www.evolt.org/article/Four_ways_to_work_with_hierarchical_data/17/4047/ Indeed! The flat table model is simple, efficient and - I think - sufficient. Thanks! I also found this article which explains the fourth method not really

Re: [PHP] Hierarchies and MySQL with PHP

2004-06-28 Thread Mattias Thorslund
Warren Vail wrote: I did one once where the key to the table was a string, and the string contained 1 to n Node Numbers separated by a separator character. 1 1.1 1.1.1 1.2 select data from table where node between (1 and 2) resulted in an entire limb of the tree being retrieved. Limitations were

Re: [PHP] SQL Join query

2004-08-07 Thread Mattias Thorslund
(*) AS num_comments FROM pic_comments GROUP BY pic_id You may want to add an ORDER BY clause to both of these. People often say it's 'good form' to enumerate your fields in the SELECT clause but benefits of that may vary between database platforms. Mattias Thorslund -- PHP General Mailing List (http

Re: [PHP] SQL Join query

2004-08-09 Thread Mattias Thorslund
(Sorry about all the quoting but I thought it makes sense for clarity - Mattias) Curt Zirzow wrote: * Thus wrote Lenar Lhmus: Mattias Thorslund wrote: Though, (regardless of SQL database platform) in a case like this, it MAY be both more straightforward and efficient to use two separate

Re: [PHP] downloading files

2004-08-19 Thread Mattias Thorslund
Aaron Todd wrote: I posted a simular question before and never really got an answer. The post drifted off into some other valuable information, but I still have the same question. I am trying to create a site with file downloads. The files on the server that are to be downloaded need to be

Re: [PHP] RE: **[SPAM]** [PHP] Correct context

2004-09-20 Thread Mattias Thorslund
Jay Blanchard wrote: [snip] Before I go screwing this code up I thought I would ask for the formatting. How would you write the following in PHP? if $entry not equal to Copy Change OR Banner Change OR

Re: [PHP] RE: **[SPAM]** [PHP] Correct context

2004-09-20 Thread Mattias Thorslund
Mattias Thorslund wrote: Disclaimer: I have probably left a silly typo somewhere. Sure did: My old nemesis, end parethesis (either too few or too many). It should be: if( != $row['photo_check']){ switch($entry){ case Copy Change: case Banner Change: case Price Change

Re: [PHP] RE: Correct context

2004-09-20 Thread Mattias Thorslund
Jay Blanchard wrote: Oops Yeah, some of us (including myself) could use a php validator in our mail clients... Maybe a plugin for T-bird? /Mattias -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

[PHP] Recommendations for php email list managers?

2004-09-21 Thread Mattias Thorslund
Hi, I'm trying to set up a list manager on a hosted site. PHPlist (phplist.com) seemed promising but I read on their forums that it takes some users hours and hours to send a couple thousand emails. Without terminal access, I suspect the PHP sending page will time out long before most of my

Re: [PHP] Re: Recommendations for php email list managers?

2004-09-21 Thread Mattias Thorslund
Manuel Lemos wrote: Hello, On 09/21/2004 04:17 PM, Mattias Thorslund wrote: I'm trying to set up a list manager on a hosted site. PHPlist (phplist.com) seemed promising but I read on their forums that it takes some users hours and hours to send a couple thousand emails. Without terminal

Re: [PHP] Re: Recommendations for php email list managers?

2004-09-21 Thread Mattias Thorslund
Matthew Weier O'Phinney wrote: * Mattias Thorslund [EMAIL PROTECTED]: I'm trying to set up a list manager on a hosted site. PHPlist (phplist.com) seemed promising but I read on their forums that it takes some users hours and hours to send a couple thousand emails. Without terminal access

[PHP] location of the PHP executable

2007-04-11 Thread Mattias Thorslund
Hi, I have looked in the documentation but can't find it: My PHP script (which is run from the command prompt - CLI) needs to know the file system location of the PHP executable. This is because it needs to run a second PHP script. I know about the which command but it's not available in all

Re: [PHP] location of the PHP executable

2007-04-11 Thread Mattias Thorslund
Jim Lucas wrote: Mattias Thorslund wrote: Hi, I have looked in the documentation but can't find it: My PHP script (which is run from the command prompt - CLI) needs to know the file system location of the PHP executable. This is because it needs to run a second PHP script. I know about

Re: [PHP] location of the PHP executable

2007-04-11 Thread Mattias Thorslund
Jochem Maas wrote: have you tried looking for this info you want? Yup, but the manual seems kind of light on the subject. I can't say for sure if it always exists but on the few boxes I tried I found and entry in both $_SERVER and $_ENV: _ = '/usr/bin/php' I found

Re: [PHP] Re: What does mean?

2007-05-01 Thread Mattias Thorslund
Man-wai Chang wrote: Bash uses only 2. PHP uses 3. And I am using this: $sql= select ... from left join ... on where . ; Exactly. I never saw the point in complicating my life with heredocs when both single- and double-quoted strings can contain

Re: [PHP] Re: What does mean?

2007-05-01 Thread Mattias Thorslund
Robert Cummings wrote: On Tue, 2007-05-01 at 08:36 -0700, Mattias Thorslund wrote: Man-wai Chang wrote: Bash uses only 2. PHP uses 3. And I am using this: $sql= select ... from left join ... on where . ; Exactly. I never saw the point

Re: [PHP] Re: Sorting times

2009-02-15 Thread Mattias Thorslund
German Geek wrote: The easiest would probably to use http://nz.php.net/manual/en/function.strnatcmp.php . It would happen to sort it the right way because am is before pm ;-). Nope. Unfortunately 12 am (midnight) comes before 1 am, and 12 pm (noon) comes before 1 pm. Since you have to

Re: [PHP] Handling (very) large files with PHP

2009-03-11 Thread Mattias Thorslund
דניאל דנון wrote: And you got a point - I don't know all the queries I'll run yet, but I'll probably do them with Perl. From what you described, it doesn't sound overly complicated to do in PHP either. If you are more familiar with PHP, it will probably take you less time to code it that

[PHP] Best way to deal with $_SERVER['REQUEST_URI'] on IIS?

2009-04-21 Thread Mattias Thorslund
Hi all, Apparently, $_SERVER['REQUEST_URI'] doesn't get set the same way when running PHP on IIS as when running it on Apache. Specifically, it seems to contain the script name only, and not the query string part. I know I can rewrite my code to piece together a $_SERVER['REQUEST_URI'] from

Re: [PHP] Best way to deal with $_SERVER['REQUEST_URI'] on IIS?

2009-04-21 Thread Mattias Thorslund
Andrew Ballard wrote: On Tue, Apr 21, 2009 at 4:04 PM, Mattias Thorslund matt...@thorslund.us wrote: Hi all, Apparently, $_SERVER['REQUEST_URI'] doesn't get set the same way when running PHP on IIS as when running it on Apache. Specifically, it seems to contain the script name only

Re: [PHP] Script to Compare Database Structures

2009-08-02 Thread Mattias Thorslund
Look into the Reverse module of PEAR MDB2. http://pear.php.net/manual/en/package.database.mdb2.intro-reverse-module.php Cheers, Mattias Matt Neimeyer wrote: I know I CAN hack something together but I hate to reinvent the wheel. I want to be able to compare the structure of two different

Re: [PHP] APC optimization in CLI

2009-08-09 Thread Mattias Thorslund
Robert Cummings wrote: Matic Meznar wrote: Hi, When running a PHP script from CLI, does APC optimize it before execution, or does APC only provide the apc_*() functions when runing in CLI mode? If I recall correctly, none of the accelerators work in CLI mode. There is a php.ini setting

Re: [PHP] Validating XML Issue

2009-09-03 Thread Mattias Thorslund
I'd say your XML document is not well formed, but validity depends on whether it conforms to the rules expressed in a schema. Mattias Alice Wei wrote: Hi, This seems like a small problem that I have read from http://us.php.net/manual/en/xmlreader.isvalid.php. I have the code snippet

Re: [PHP] Extract links from strings

2009-09-21 Thread Mattias Thorslund
Jônatas Zechim wrote: Hi there, i've the following strings: $string1 = 'Lorem ipsum dolor http://site.com sit amet'; $string2 = 'Lorem ipsum dolor http://www.site.com/ sit amet'; $string3 = 'Lorem ipsum dolor http://www.site.net sit amet'; How can I extract the URL from these strings? They can

[PHP] SimpleXML var_dump() weirdness

2009-10-13 Thread Mattias Thorslund
Hi, It seems that var_dump() of a SimpleXMLElement does not show an attribute of elements that contain text content? I hope my examples might show what I mean: $xml = 'root rootattr=root valueinner attr=value//root'; $simple = new SimpleXMLElement($xml); var_dump($simple); echo

Re: [PHP] Re: Time zone discrepancy - America/New_York = CDT?

2009-11-01 Thread Mattias Thorslund
The output I get (after adding newlines to the output) is: America/New_York EST EST EST PHP 5.2.10. I suspect this comes from the operating system. Maybe update your tzdata package if you're on a Linux system. Cheers, Mattias Nathan Lebovic wrote: Sorry there was a typo in that output.

Re: [PHP] Server-side encryption to prevent form hacking: new idea?

2009-12-11 Thread Mattias Thorslund
Kelly Jones wrote: If you have an HTML form select field xyz with possible values apple, banana, and cucumber, anyone can easily set xyz to an arbitrary value. To prevent this, I create a hidden field code[xyz] with value: base64_encode(mcrypt_ecb(

[PHP] Resin/Quercus

2010-01-06 Thread Mattias Thorslund
Hi, I wonder if anyone has experience with running PHP on the Resin server. Opinions, good, bad? Gotchas? Similar projects? http://www.caucho.com/projects/resin/ Thanks, Mattias -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] POLL: To add the final ? or not...

2010-01-08 Thread Mattias Thorslund
Hadn't paid much attention to the issue until reading a previous discussion on the topic, here on this list. After that, I decided to be consistent and leave the closing ? out in all include files. To my eyes, ? means look there is more content coming, which seems kind of silly when there

Re: [PHP] Formatting Decimals

2010-01-10 Thread Mattias Thorslund
Testing this out a little: matt...@mumin:~$ php -r 'echo \$.number_format(0.109, 2, ., ,).\n;' $0.11 matt...@mumin:~$ php -r 'echo $.number_format(0.109, 2, ., ,).\n;' $0.11 matt...@mumin:~$ php -r 'echo $.number_format(0.109, 2, ., ,).\n;' $0.11 I think the $ should be escaped with a

Re: [PHP] Formatting Decimals

2010-01-11 Thread Mattias Thorslund
tedd wrote: At 2:55 PM -0500 1/11/10, Rick Dwyer wrote: I have been asked to further modify the value to the nearest half cent. So if the 3rd decimal spot ends in 1 or 2, it gets rounded down to 0 If it ends in 3, 4, 5, 6 it gets rounded to 5. And if it 7, 8 or 9 it gets rounded up to full

Re: [PHP] POLL: To add the final ? or not...

2010-01-14 Thread Mattias Thorslund
Kim Madsen wrote: Mattias Thorslund wrote on 09/01/2010 02:26: A neat thing with pairing every ?php with a ? when mixed in HTML is that these are valid XML processing instructions. If your HTML satisfies XML well-formedness, your PHP document will also be valid XML. Not that I've ever had any

Re: [PHP] Spreadsheet_Excel_Reader problem

2010-03-18 Thread Mattias Thorslund
Paul M Foster wrote: I process a lot of CSV files, and what I typically see is that Excel will enclose fields which might contain commas in quotes. This gets messy. So I finally wrote a C utility which parses the file and yields tab-delimited records without the quotes. Paul And fgetcsv()

Re: [PHP] any reason *not* to use PEAR DB module when accessing mysql?

2010-03-19 Thread Mattias Thorslund
Robert P. J. Day wrote: (just a warning -- as a relative newbie to PHP, i'll probably have the occasional dumb question. just humour me.) i'm looking at some existing PHP code that accesses a mysql 5.0 db, and it's coded using the mysql-specific calls: mysql_connect, mysql_select_db, etc,

Re: [PHP] Sort two coupled arrays

2010-04-07 Thread Mattias Thorslund
Piero Steinger wrote: Am 07.04.2010 22:09, schrieb tedd: Hi gang: Here's the problem -- I want to sort and combine two arrays into one sorted array. Here's a real-world example: Array 1 ( [1] = 75 [2] = 31 [3] = 31 [4] = 31 [5] = 40 ) Array 2 ( [1] = Personal Email

[PHP] floored by floor()

2010-10-13 Thread Mattias Thorslund
Hi List, I'm having a problem with the behavior of the floor() function: echo floor(327.03 * 100).\n; //prints 32702 and not 32703!! Sanity check: var_dump(327.03 * 100); //prints float(32703) as expected Any ideas why this happens, and how to work around it? Thanks, Mattias -- PHP

Re: [PHP] floored by floor()

2010-10-14 Thread Mattias Thorslund
On 10/13/2010 11:56 PM, gaojian wrote: 在 2010-10-13三的 22:48 -0700,Mattias Thorslund写道: Hi List, I'm having a problem with the behavior of the floor() function: echo floor(327.03 * 100).\n; //prints 32702 and not 32703!! Sanity check: var_dump(327.03 * 100); //prints float(32703

Re: [PHP] floored by floor()

2010-10-14 Thread Mattias Thorslund
On 10/13/2010 11:14 PM, Glen Fuller wrote: On 10/13/2010 10:48 PM, Mattias Thorslund wrote: Hi List, I'm having a problem with the behavior of the floor() function: echo floor(327.03 * 100).\n; //prints 32702 and not 32703!! Sanity check: var_dump(327.03 * 100); //prints float(32703

Re: [PHP] How to PHP get bit depth of a given PNG image file?

2011-06-16 Thread Mattias Thorslund
On 06/15/2011 10:11 PM, Nam Gi VU wrote: Hi everyone, In PHP code, given an .png image path, I need to detect the bit-depth of that image. How can I do that? I've tried to use getImageSize() and read the bits as below sample code but it always returns '8' for 24-bits/32-bits image. Reading

Re: [PHP] How to PHP get bit depth of a given PNG image file?

2011-06-16 Thread Mattias Thorslund
I think the documentation is a bit unclear about the fact that colors and channels are the same thing here. The line about bits should probably say bits is the number of bits for each *channel*. Mattias On 06/15/2011 11:11 PM, Nam Gi VU wrote: Thank you Mattias, I'll look at `channels`

Re: [PHP] Help on number matching function

2011-09-16 Thread Mattias Thorslund
If one or both of your data sets are in MySQL already, there may be no need to do the comparison in PHP. Just use IN() or INNER JOIN. Or is there some particular reason why neither of these will work in your case? Cheers, Mattias On 09/16/2011 05:36 AM, Dare Williams wrote: Dear PHP Group,

[PHP] crash dump on OS X Server: PHP / Apache

2012-10-09 Thread Mattias Thorslund
Perhaps someone can read this backtrace. This is a problem that causes Apache to not send any output at all. Doing a die() just before one particular require_once prevents the issue. If I move that die() into the required file and place it just after the opening PHP tag, I get the error

Re: [PHP] A relative date puzzle

2013-04-01 Thread Mattias Thorslund
On 4/1/13 11:05 AM, Jim Giner wrote: I'm looking for some ideas on how to handle the following get a datetime value that is relative to a specific future date when presented with a partial day time value. Specifically, I have an appl that requires some lengthy input involving days and times.

Re: [PHP] A relative date puzzle

2013-04-01 Thread Mattias Thorslund
On 4/1/13 11:15 AM, Mattias Thorslund wrote: On 4/1/13 11:05 AM, Jim Giner wrote: I'm looking for some ideas on how to handle the following get a datetime value that is relative to a specific future date when presented with a partial day time value. Specifically, I have an appl that requires

Re: [PHP] Friday's Question

2013-09-20 Thread Mattias Thorslund
40, and no mouse pad atm. Seems that this table top is okay. This is an optical mouse without a ball underneath. However this mac-y-mouse DOES have a ball on top, for scrolling. Go figure. Mattias -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: