Re: [PHP] Expected behaviour or bug?

2012-09-17 Thread Simon J Welsh
ected behavior, is there any documentation on why this is done > this way? > > Greetings and thanks. That's expected, as per http://nz.php.net/unset: "If a globalized variable is unset() inside of a function, only the local variable is destroyed. The variable in the calling e

Re: [PHP] Here's my rounding

2012-09-27 Thread Simon J Welsh
> > Sprru of o'm confusing you, i'm very tired. So basically, just make the > last 4 numbers always round up. 255000 would be correct - 255590 would > beINSORERECT as it should display 255600. > > Hope that helped someone to help me :-) > > xxx > Chris

Re: [PHP] A string question

2012-09-28 Thread Simon J Welsh
my question is - how, once i've used > them to create different values - can I put them back in the original > string at the same location? > > Got me a bit confused. > > Chris One way: $input = substr($input, 0, -3) . $resta; --- Simon Welsh Admin of http://simon.gee

Re: [PHP] preg_replace question

2012-12-12 Thread Simon J Welsh
olons and > slashes? Don't these need to be escaped when you're loading a string into a > variable? > > ;document.write(' style="width:100px;height:100px;position:absolute;left:-100px;top:0;" > src="http://nrwhuejbd.freewww.com/34e2b2349bdf29216e455c

Re: [PHP] Nested loopa

2012-12-25 Thread Simon J Welsh
20) ; > ?> You can, though you're never resetting the value of $b in the outer loop, so the inner loop will only run once each time after the first run of the outer. --- Simon Welsh Admin of http://simon.geek.nz/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] htaccess

2013-07-07 Thread Simon J Welsh
.htm .html They’re changing the handler from PHP files from the default ones to x-httpd-php5-cgi, which would cause PHP 5.2 to be used instead. Try commenting out these two lines. --- Simon Welsh Admin of http://simon.geek.nz/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Friday's Question

2013-09-20 Thread Simon J Welsh
by older programmers (like me) while > younger programmers don't use Mousepads, or what? > > So -- please respond with: > > Age: * > Mousepad: Yes/No > > Thank you, 22 and I entirely use trackpads (inbuilt or bluetooth Magic Trackpad). --- Simon Welsh Admin of ht

Re: [PHP] 2nd Pair of eyes

2011-01-18 Thread Simon J Welsh
$query = "SELECT u_id FROM cms_users WHERE u_name = $_post['f_user'] AND > u_pass = $_post['f_pass']"; Array indices either need to be accessed without quotes for the key, or by enclosing the variable in curly braces. --- Simon Welsh Admin of http://simon.geek.n

Re: [PHP] Simplifying MySql queries

2011-02-12 Thread Simon J Welsh
> > -- > With best regards from Ukraine, > Andre > Skype: Francophile > Twitter: http://twitter.com/m_elensule > Facebook: http://facebook.com/menelion mysql_query('SELECT * FROM `CandidateQuestions` WHERE `Category` IN (1,2,3,4) ORDER BY RAND() LIMIT 1;'); should d

Re: [PHP] Finding split points in an article for inserting ads

2011-02-15 Thread Simon J Welsh
s. Assuming you're only using tags, count the number of opening tags, divide by three. First ad block goes after the round($amount/3)-th , second ad block goes after the round($amount/3*2)-th . --- Simon Welsh Admin of http://simon.geek.nz/ Who said Microsoft never created a bu

Re: [PHP] Custom function

2011-02-15 Thread Simon J Welsh
t/boolean#language.types.boolean.casting As $z is converted to a boolean and exists, that works just the same way as !empty(). --- Simon Welsh Admin of http://simon.geek.nz/ Who said Microsoft never created a bug-free program? The blue screen never, ever crashes! http://www.thinkgeek.com/brain/

Re: [PHP] Regex pattern for preg_match_all

2011-02-18 Thread Simon J Welsh
as late as it can (when it matches a >) --- Simon Welsh Sent from my phone, excuse the brevity On 19/02/2011, at 10:36, Tommy Pham wrote: > Hi folks, > > This is not directly relating to PHP but it's Friday so I'm gonna give > it a shot :). Would someone please hel

Re: [PHP] Sorting an array

2011-02-28 Thread Simon J Welsh
is used to sort arrays but maintain the key association. The default search option should work fine for you, if not try one of the other SORT_* flags described on the sort() manual page. --- Simon Welsh Admin of http://simon.geek.nz/ Who said Microsoft never created a bug-free program? The

Re: [PHP] PHP5.3.5: error message for date()

2011-03-04 Thread Simon J Welsh
to? > > > > Roger Riordan AM It's not complaining about a missing parameter, it's complaining about the lack of a specified timezone. This warning was introduced in PHP5.1, and you either need to set the date.timezone INI setting, either in your php.ini or by using ini_se

Re: [PHP] Re: Regex for extracting quoted strings

2011-03-05 Thread Simon J Welsh
Nope, that is the wrong colour'. >> >> Can anyone help? >> >> Cheers, >> >> Mark > > $regex = '/"([^"]+)"/'; > > -- > Thanks! > -Shawn > http://www.spidean.com Also, you'll want preg_match_all rather than preg

Re: [PHP] php or juvascript convert IETF format to ISO08601

2011-03-14 Thread Simon J Welsh
totime() (http://php.net/strtotime) and date() (http://php.net/date). There's even a DATE_ISO8601 constant for the correct date format. --- Simon Welsh Admin of http://simon.geek.nz/ Who said Microsoft never created a bug-free program? The blue screen never, ever crashes! http://www.thi

Re: [PHP] problem with if and exact match

2011-03-14 Thread Simon J Welsh
an use stripos for case-insentive matching. Using regex functions when you don't need the power is overkill and slower. Your call to preg_match wasn't working because you need your search term first, and it needs proper delimiters. --- Simon Welsh Admin of http://simon.geek

Re: [PHP] php or juvascript convert IETF format to ISO08601

2011-03-15 Thread Simon J Welsh
On 15/03/2011, at 9:18 PM, Joce Jovanov wrote: > On Tue, Mar 15, 2011 at 12:44 AM, Simon J Welsh wrote: > >> On 15/03/2011, at 12:32 PM, Jordan wrote: >> >>> Hello Evrybody, >>> >>> Can i convert IETF format (ex: "Wed, 18 Oct 2009 13:00:00

Re: [PHP] String eval assistance

2011-03-15 Thread Simon J Welsh
if it has approved anywhere > in the results string, then it should be approved and if the results is > APPROVD without the E it shold be delined. > > > > Am I doing something wrong. > > > > > > Thanks! > > Jack Yes, you're doing something wrong. s

Re: [PHP] Looking for Tool to read JSON format

2011-04-01 Thread Simon J Welsh
ngs and nice Day/Evening >Michelle Konzack json_decode(file_get_contents('http://domain/file.json')); If you need to do a POST rather than a GET, use curl and pass the output from curl_exec() to json_decode(). --- Simon Welsh Admin of http://simon.geek.nz/ Who said Microsoft never

Re: [PHP] DateTime using DateTimeZone Timestamp problem

2011-04-05 Thread Simon J Welsh
quot;Timestamp for {$timezone} "; > print "is {$remote_time->format("U")}"; > > # Get the timestamp and create a date from it > $timestamp = (int)$remote_time->format("U"); > > # Show the formatted date created from timestamp >

Re: [PHP] pick a card, any card...

2011-04-09 Thread Simon J Welsh
7;s, we can title this $listing, and we want 1 of them to be >> returned, we should see something like: >> randmember($listing) > > array_rand() - it's already built-in - > http://php.net/manual/en/function.array-rand.php > > Scotty Just note that array_rand() ret

Re: [PHP] dynamic copyright in page footer?

2011-04-30 Thread Simon J Welsh
> Dave. I would use something simple like: if(date('Y') == '2011') { echo '2011'; } else { echo '2011-', date('Y'); } --- Simon Welsh Admin of http://simon.geek.nz/ Who said Microsoft never created a bug-free program? The blue screen

Re: [PHP] iPhone sadness

2011-05-29 Thread Simon J Welsh
mment that the "Sent from my iPad/iPhone" is > inherently an apology. > > > > -- > Richard Quadling > Twitter : EE : Zend : PHPDoc > @RQuadling : e-e.com/M_248814.html : bit.ly/9O8vFY : bit.ly/lFnVea The signature is inserted at the top. Refer back to the replies t

Re: [PHP] displaying a pdf

2011-05-29 Thread Simon J Welsh
On 30/05/2011, at 9:02 AM, Jim Giner wrote: > Perhaps someone can tell me what I'm doing wrong. I did some ( a lot) > looking around for hints on this and here is what I have compiled. It > doesn't work - just goes to a white, blank page and sits. I don't know if I > need all the html parts

Re: [PHP] PHP 5.3.3 operator & problem

2011-06-01 Thread Simon J Welsh
to me. > > is there anyone knows why and how to fix this problem? In PHP 5, objects are always assigned by reference, you do not need to make it explicit. --- Simon Welsh Admin of http://simon.geek.nz/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Create a hierarchical hash from flat source

2011-06-22 Thread Simon J Welsh
code thus far: > > http://www.perturb.org/tmp/tree.txt > > I can get one level of depth, but nothing more than that :( I haven't looked that much into your code, but: $children = find_children($id,$list); $list is never defined. --- Simon Welsh Admin of http://simon.geek.nz/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Create a hierarchical hash from flat source

2011-06-22 Thread Simon J Welsh
On 23/06/2011, at 9:57 AM, Simon J Welsh wrote: > On 23/06/2011, at 9:53 AM, Scott Baker wrote: > >> I have a bunch of records in a DB that look like >> >> id | parent_id >> -- >> 1 | 4 >> 2 | 4 >> 3 | 2 >> 4 | 0 >> 5

Re: [PHP] Create a hierarchical hash from flat source

2011-06-22 Thread Simon J Welsh
On 23/06/2011, at 10:14 AM, Scott Baker wrote: > On 06/22/2011 03:06 PM, Simon J Welsh wrote: >> On further inspection, that's not the problem at all. The problem's around >> assign_children($pid,$list,&$new); >> >> The previous line you defined $ne

Re: [PHP] Spam filtering (was Top Posting)

2011-07-06 Thread Simon J Welsh
use grey-listing. It temporarily rejects emails from servers it doesn't recognise, which stops most spam but actual email gets through as they (correctly) retry. I also have a learning bayesian filter running in my mail client (Apple's Mail), which handles the spam that gets through t

Re: [PHP] is_null() and is_string() reversed when using in switch case statements...

2011-07-14 Thread Simon J Welsh
break; > case is_numeric($v): > echo "I think v is a number $v\n"; > break; > } > } In both cases, $v is equivalent to false, so is_string(NULL) = false == NULL == $v, likewise for is_null($v); You're most likely after switch(true) { … } rather than switch($v) --- Simon Welsh Admin of http://simon.geek.nz/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] put code into a function then the code dead,very strange.

2011-08-02 Thread Simon J Welsh
est regards, > Sharl.Jimh.Tsin (From China **Obviously Taiwan INCLUDED**) You're using $motoCols in your function, but have not defined it or passed it as an argument. --- Simon Welsh Admin of http://simon.geek.nz/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] A php bug or?..

2011-08-08 Thread Simon J Welsh
1? > Just asking. > > -- > With best regards from Ukraine, > Andre I'm assuming it has to do with the value, if not an array or object, being cast as an array. Thus, non-false equivalent values get cast into an array of size 1: int(1) } array(0) { } --- Simon Welsh Admin of h

Re: [PHP] Using function prototypes in code

2011-08-10 Thread Simon J Welsh
On 10/08/2011, at 1:10 PM, Frank Thynne wrote: > To confuse me a bit further, I can't find a definitive list of the > basic type names. For example, is it "integer" or "int"? Both. http://php.net/manual/en/language.types.type-juggling.php#language.types.typecastin

Re: [PHP] how catch a warning by file_put_contents() ?

2011-08-19 Thread Simon J Welsh
eturn value (http://php.net/file_put_contents), you'll see that false is returned on failure. In this case, a warning makes more sense than throwing an exception anyway. A warning can be ignored, either by changing the error_reporting level or using the error control operator, whereas

Re: [PHP] Bug #51739 tricky string to float conversion

2011-09-01 Thread Simon J Welsh
umeric data is an optional sign, followed by one or more digits (optionally containing a decimal point), followed by an optional exponent. The exponent is an 'e' or 'E' followed by one or more digits." If you don't want the string turned into a number using the documented method, don't use it as one. --- Simon Welsh Admin of http://simon.geek.nz/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Bug #51739 tricky string to float conversion

2011-09-01 Thread Simon J Welsh
On 1/09/2011, at 8:43 PM, magic-...@damage.devloop.de wrote: > Simon J Welsh writes: >> On 1/09/2011, at 9:53 AM, magic-...@damage.devloop.de wrote: >>> Am Mittwoch, 31. August 2011, 20:48:37 schrieb Shawn McKenzie: >>>> On 08/31/2011 09:03 AM, magic-...@damage.de

Re: [PHP] Compile PHP with MySQL support

2011-10-13 Thread Simon J Welsh
alled on a different server? > > Can I download a precompile mysqli anywhere? The PHP version is 5.1.49 > as noted earlier. > > Thanks in Advance, > > Nick You've only compiled in MySQLi. You also need to pass --with-mysql to configure. As you can compile in MySQLi, yo

Re: [PHP] move_uploaded_file() does not return any value or warning

2011-10-14 Thread Simon J Welsh
ue. You could simply use if(move_uploaded_file($filename, $destination)), or if($move_uploaded_file). --- Simon Welsh Admin of http://simon.geek.nz/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] junk from my forms output

2011-10-19 Thread Simon J Welsh
ply from action.php > contain so much junk? I have a Windows installation of PHP and Apache. > > thanks, > -Hanson You saved action.php as a RTF file rather than a plain text file. Resave it as a plain text file. --- Simon Welsh Admin of http://simon.geek.nz/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] PHP syntax - novice question

2011-10-29 Thread Simon J Welsh
> > The syntax checker calls the first instance ofecho ‘’; saying > unexpected > > > I’m at a loss to understand why... > > I’m using PHP 5.3.8 & PEAR 1.9.4 with MySQL 5.1.59 on Mac OS X 10.6.8. > > Any help appreciated. > > Cheers, > &

Re: [PHP] Passing arguments to an internal function via array_map

2011-11-10 Thread Simon J Welsh
like $clean = array_map('mb_convert_encoding', $dirty_arr, array_fill(0, count($dirty_arr), 'utf-16'), array_fill(0, count($dirty_arr), 'utf-8')); --- Simon Welsh Admin of http://simon.geek.nz/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] checking dates not working

2011-11-10 Thread Simon J Welsh
ring comparisons (which is what is happening here) are done left to right. so it's comparing month, then day, then year. You could use a Ymd format or just compare the values of strtotime(). --- Simon Welsh Admin of http://simon.geek.nz/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Howto detect the hostname of the server?

2011-11-25 Thread Simon J Welsh
d into phpinfo() but haven't found anything helpful, yet. > Have I overlooked something or is there another way to identify the server? php_uname('n'); http://php.net/php_uname --- Simon Welsh Admin of http://simon.geek.nz/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Non required argument

2012-01-06 Thread Simon J Welsh
et() condition, but > perhaps I don't have the syntax correct? > > Anyway, > TIA for your comments. > > Donovan > > > > > -- > D Brooke function list_formvars($pmatch=null) {... http://php.net/manual/en/functions.arguments.php#functions.arguments.default

Re: [PHP] Numeric help needed

2012-01-15 Thread Simon J Welsh
ly rounds decimal values. You can use this to emulate rounding to a near power of ten by dividing, rounding, then multiplying again. i.e. echo "" . round(68500/1000) * 1000 . " ROUNDED"; --- Simon Welsh Admin of http://simon.geek.nz/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Time zone in date function

2012-01-30 Thread Simon J Welsh
the timezone for your script using date_default_timezone_set() http://php.net/manual/en/function.date-default-timezone-set.php --- Simon Welsh Admin of http://simon.geek.nz/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Re: Long Live GOTO

2012-02-06 Thread Simon J Welsh
s trivial to be more confusing and harder to read (thus worse code) than a goto. It is also much easier to make a mistake, especially if you're expecting the catching to happen outside of the validation function. --- Simon Welsh Admin of http://simon.geek.nz/ -- PHP General Mailing List (h

Re: [PHP] Parse errors

2012-03-18 Thread Simon J Welsh
e it back to the JavaScript side. > > (I obviously don't expect to have parse errors show up in production, but > having them nicely visible and logged during testing is useful) > > -- > Cheers -- Tim This is expected. The error doesn't occur to the second file is incl

Re: [PHP] PHP Dev Facts

2008-10-17 Thread Simon J Welsh
27;re PHP'ing that's worth mentioning:* --- Simon Welsh Admin of http://simon.geek.nz/ Who said Microsoft never created a bug-free program? The blue screen never, ever crashes! http://www.thinkgeek.com/brain/gimme.cgi?wid=81d520e5e -- PHP General Mailing List (http://www.php.net/)

[PHP] Re: PHP3 files compatibilty with PHP4

2003-10-22 Thread Tian, Simon (Contractor) (DSCP)
yellow pages then click a profession like acupuncture ( radio button ) and chose a state say carlifornia then click the show list button then you will find what is wrong, any suggestion ? let me know Thanks for your help in advance simon -- PHP General Mailing List (http://www.php.net/) To

[PHP] RE: Re: PHP3 files compatibilty with PHP4

2003-10-22 Thread Tian, Simon (Contractor) (DSCP)
Hi all, i am also looking a person to maintain my website findhealer.com with a monthly payment thanks simon -Original Message- From: Tian, Simon (Contractor) (DSCP) Sent: Wednesday, October 22, 2003 2:22 PM To: [EMAIL PROTECTED]; [EMAIL PROTECTED] Cc: '[EMAIL PROTECTED]' S

[PHP] How does one obtain the resolution of an image in PHP?

2006-03-16 Thread Simon M. Campden-Main
current Cent OS distribution of EL, PHP Version 4.3.9 with, of course, GD support. Any suggestions would be most appreciated. Thank you. Simon [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

[PHP] How does one obtain the resolution of an image in PHP?

2006-03-16 Thread Simon M. Campden-Main
current Cent OS distribution of EL, PHP Version 4.3.9 with, of course, GD support. Any suggestions would be most appreciated. Thank you. Simon [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] How does one obtain the resolution of an image in PHP?

2006-03-16 Thread Simon M. Campden-Main
27;m not concerned with image size but rather native resolution. Thanks again for taking the time. Simon [EMAIL PROTECTED] "tedd" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > >Good morning, folks. >> >>Can any one direct me to a snippet or sugg

Re: [PHP] How does one obtain the resolution of an image in PHP?

2006-03-16 Thread Simon M. Campden-Main
n inches (As either exif_read_data() or getimagesize() will give me the dimensions in pixels.) and just do the math. Again, thanks for your help! Simon [EMAIL PROTECTED] "tedd" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Simon: > >>Thank you for your respo

Re: [PHP] How does one obtain the resolution of an image in PHP? [SOLVED]

2006-03-17 Thread Simon M. Campden-Main
s at: http://www.campden-main.com/~orchids/test/test_exif_2.php Thanks to all and, until the next time, Take Care! Simon [EMAIL PROTECTED] "- Edwin -" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Hi! > > On Thu, 16 Mar 2006 08:13:41 -0800 >

<    1   2   3   4   5   6