Re: [PHP] using new AUTOGLOBALS

2002-04-05 Thread Philip Olson
r use, so do as you will. extract() has many many options, read about them: http://ca.php.net/extract All of the above should give ideas, have fun! Regards, Philip Olson p.s. Use a mirror http://uk.php.net/mirrors.php On Fri, 5 Apr 2002, Miguel Cruz wrote: > On Fri, 5 Apr 2002, cybe

Re: [PHP] New to PHP Need Help

2002-04-04 Thread Philip Olson
umerated array (numerical) print $row[1]; Or use a function like mysql_fetch_assoc instead: $row = mysql_fetch_assoc($result); print $row['id']; // with id being a column name // selected via the query print $row['name']; And lastly, if you're

Re: [PHP] checkbox doesn't pass?

2002-04-04 Thread Philip Olson
Unchecked checkboxes pass no values, that's how it works. It's either set or not. Default value for a checkbox is 'on' although you can change that. isset() will work fine. Regards, Philip -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub

Re: [PHP] Emulation: $var = print_r($array)

2002-04-04 Thread Philip Olson
> > Is there a way to "emulate" var_dump(), print_r() so I can write it to a > > file and when I open this file the information are shown like if I really > > did a print_r();? > > ob_start(); > print_r($doo); > $dah = ob_get_contents(); > ob_end_clean(); > echo $d

Re: [PHP] suggestions on work-arounds to highlight_file() ?

2002-04-03 Thread Philip Olson
I meant to use highlight_file instead of highlight_string, doh! I'll go back in time and modify the source below :) Philip On Thu, 4 Apr 2002, Philip Olson wrote: > > A note exists at http://www.php.net/highlight_file that says: > > Note: The return parameter became

Re: [PHP] suggestions on work-arounds to highlight_file() ?

2002-04-03 Thread Philip Olson
utput buffering, something like: function ob_highlight_file($filename) { ob_start(); highlight_string($filename); $source = ob_get_contents(); ob_end_clean(); return $source; } Be sure to pay attention to notes and warnings within the PHP manual. Regards, Philip Olson

Re: [PHP] PHP FAQ (again)

2002-04-03 Thread Philip Olson
is a good idea too. The PHP manual and website are live entities always looking for ways to improve. Regards, Philip Olson p.s. http://www.google.com/ is your friend. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Warning: Undefined variable

2002-04-02 Thread Philip Olson
liar has its purpose but usually an array will do (please!). When in doubt, put error_reporting(E_ALL) on top of your script and go to town. Regards, Philip Olson On Tue, 2 Apr 2002, Erik Price wrote: > > On Tuesday, April 2, 2002, at 03:27 PM, Philip Olson wrote: > > > If you&#

Re: [PHP] Warning: Undefined variable

2002-04-02 Thread Philip Olson
d other things. If you're distributing code in cyberspace it's a good idea to make it error free too, E_NOTICE or otherwise. Regards, Philip Olson -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Need some help please

2002-04-01 Thread Philip Olson
t 'Success! Row added.'; } In short, mysql_error() is your friend. Regards, Philip Olson On Tue, 2 Apr 2002, menezesd wrote: > Hello Friends. > > I know I am asking for too much. But somehow, I am stuck > with three books I am refering and still not being able to >

Re: [PHP] Warning: Undefined variable

2002-04-01 Thread Philip Olson
#ini.error-reporting A function also controls this behavior within scripts, it's appropriatly named error_reporting() http://www.php.net/error_reporting So, start programming your code with error_reporting(E_ALL) and have fun! Regards, Philip Olson p.s. Although it's fairly common

Re: [PHP] Not Quite: how to build an array

2002-02-23 Thread Philip Olson
27;, $row['something']); } print_r($authors); Rename your field to something other then AS, like perhaps "authors" or something ;) Also eventually learn about "Database Normalization". Regards, Philip Olson > OK. I use: > > while ($mydata = mysql

RE: [PHP] unset a function?

2002-01-30 Thread Philip Olson
> include_once() won't help. In fact, he is including each file only once. > He wants to have a function with the same name in each file. That's the > kicker... oh well that's silly, don't do that. also consider function_exists() regards, Philip Olson -- P

Re: [PHP] unset a function?

2002-01-30 Thread Philip Olson
This sounds like a job for include_once www.php.net/include_once regards, Philip Olson On Wed, 30 Jan 2002, Bas Jobsen wrote: > Hello, > > I have this: > include("file1"); > function_somename(); > include("file2"); > function_somename(); > ?&g

Re: [PHP] MySQL Fetch_Array VS. Fetch_Object

2002-01-30 Thread Philip Olson
, MYSQL_ASSOC); Or just use mysql_fetch_assoc(). Regarding extract(), if this is the desired affect (as proposed in the original question), then: SELECT foo FROM bar extract($row); print $foo; Now, mysql_fetch_row is _slightly_ faster then both of these but who's counting. Regards, Philip

Re: [PHP] I'm not sure how to do some simple code...

2002-01-26 Thread Philip Olson
Have a look around: http://www.php.net/strip_tags Regarding simple matches, consider: http://uk.php.net/stristr And who knows, maybe you want: http://us.php.net/htmlspecialchars Learn about if/else: http://au.php.net/else Regards, Philip Olson On Fri, 25 Jan 2002, Leif K-Brooks

RE: [PHP] Variable Problem

2002-01-19 Thread Philip Olson
.variables.predefined.php That page is in Japanese, hope it makes sense to you as it sure doesn't to me :) Regards, Philip Olson On Sat, 19 Jan 2002, Steven Maroney wrote: > > I hope im on the right track Cause im jumping in on this post. > > $MYCHK isn't an array cau

Re: [PHP] Variable Problem

2002-01-18 Thread Philip Olson
es which include while/list alternatives: http://www.php.net/manual/en/control-structures.foreach.php Your question was answered below but I couldn't resist throwing in a little array propaganda, jic :) Arrays work great in forms too! http://www.php.net/manual/en/faq.html.php#AEN73718 Re

Re: [PHP] Writing Array to File w/o blank lines

2002-01-13 Thread Philip Olson
:) And, use fclose(). Also for good measure, you may want to check if $file is_writable() first. Regards, Philip Olson p.s. Please keep questions to one thread. On Sun, 13 Jan 2002, Andrew V. Romero wrote: > I have been working on a script that manipulates arrays and now I am > working

Re: [PHP] Re: [PHP-DEV] Re: strtok bug

2002-01-13 Thread Philip Olson
This is documented now which is as best we can do at this point. That and clearly document all BC breaks in the future. I vow to help on the documentation end. Regards, Philip Olson On Mon, 14 Jan 2002, Manuel Lemos wrote: > Hello, > > I don't disagree, but the fact is that d

Re: [PHP] strtok bug

2002-01-13 Thread Philip Olson
Are you referring to the change with 4.1.0 that's documented in the manual? Have another look, it gives examples of new/old behavior: http://www.php.net/strtok Regards, Philip Olson On Sun, 13 Jan 2002, Robert Mena wrote: > Hi, does anybody know when the strtok bug introduced &g

Re: [PHP] PHP question regarding Cold Fusion

2002-01-11 Thread Philip Olson
iation being sendtohost() http://dodds.net/~cardinal/sendtohost.txt regards, Philip Olson -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]

RE: [PHP] quick question

2002-01-11 Thread Philip Olson
a]"; // an apple As are: print "an {$arr['a']}"; // an apple print "an ". $arr['a']; // an apple Anyway, maybe that helps explain a few things :) Regards, Philip Olson -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]

Re: [PHP] printing php variable into html > print $result; ?

2002-01-03 Thread Philip Olson
here: http://www.php.net/manual/en/language.types.resource.php Regards, Philip Olson On Fri, 4 Jan 2002, louie miranda wrote: > Hi, is it possible to print the sql query? i mean > i want to print the output of the command "SELECT * FROM members;" > and output it into html, i

Re: [PHP] Re: Generate Alphabet

2001-12-27 Thread Philip Olson
> I seriously doubt your code works -- have you tested it? I think the code > you submitted will most probably output "1 2 3 4...24 25 26" (spaces are > actually \n's). I never tested it though, so I may be mistaken. Yes, it works. Test it before posting such doubts :

Re: [PHP] Re: Generate Alphabet

2001-12-27 Thread Philip Olson
> This will only work with PHP 4.1.0 or later. Consider this example: $letter = 'a'; $i = 0; while ($i++ < 26) { print "Letter: ". $letter++ ."\n"; } regards, Philip Olson -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAI

Re: [PHP] Reverse effect of htmlspecialchars

2001-12-25 Thread Philip Olson
> Anyway to reverse the effect of htmlspecialchars? See the docs found here: http://www.php.net/manual/en/function.get-html-translation-table.php Shown there is a way to do this. Regards, Philip Olson -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EM

Re: Re: [PHP] 4.10 New Vars Question

2001-12-25 Thread Philip Olson
her than those on the changelog too. The new vars will be listed and described in the manual eventually (fairly soon). For now, read the above release notes. Regards, Philip Olson -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional com

Re: [PHP] 4.10 New Vars Question

2001-12-25 Thread Philip Olson
variables section of manual and phpinfo(). regards, Philip Olson On Tue, 25 Dec 2001, Edward Marczak wrote: > Hello! > > Two items in the new 4.10 change-log caught my attention: > > *Introduced a new $_REQUEST array, which includes any GET, POST or > COOKIE variables. Like the o

Re: [PHP] Client side fatal PHP error

2001-12-25 Thread Philip Olson
will happen every time. Check your error_reporting setting *shrugs* See the email I just posted. > Ah it's always something thanks much. Yep :) Regards, Philip Olson -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional comm

Re: [PHP] Client side fatal PHP error

2001-12-25 Thread Philip Olson
2 Anyway, what was the question again? :) Regards, Philip Olson -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]

Re: [PHP] Client side fatal PHP error

2001-12-25 Thread Philip Olson
)) != "H" && > srtoupper(substr($xmbrcode,11,1)) != "O") { See above. Btw, consider something like: $str = '123456789abcdef'; $bad = array('B','P','H','O'); if (in_array(strtoupper($str{11}),$

Re: [PHP] Re: spliti[SOLUTION]

2001-12-22 Thread Philip Olson
s will exist. This will also make for a more reliable word count although it won't be perfect. For examples on posix regex (which is taken on by split), see: http://www.phpbuilder.com/columns/dario19990616.php3?print_mode=1 regards, Philip Olson On Sat, 22 Dec 2001, Bharath Bhushan Lohray

Re: [PHP] Function definition: how to make default argument an emptyarray?

2001-12-22 Thread Philip Olson
> In pseudo-code: > > function makeyogurt ($flavour, $type = 'EMPTY ARRAY') > { } function makeyogurt ($flavour, $type = array()) { ... } or function makeyogurt ($flavour, $type = array('a','b')) { ... } regards, Philip

Re: [PHP] Does mail() can be used to send attachments?

2001-12-22 Thread Philip Olson
see: http://www.php.net/manual/en/function.mail.php a link to a tutorial/rfc exists there. also, check the various script archives for mail packages, most allow for attatchments. regards, Philip Olson On 22 Dec 2001, Dasmeet Singh Arora wrote: > Is it possible to send attachments us

Re: [PHP] SSI

2001-12-22 Thread Philip Olson
lude() in php manual too. Regards, Philip Olson On Fri, 21 Dec 2001 [EMAIL PROTECTED] wrote: > if you have a PHP page and you want to use SSI in it... is there a special > method? > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMA

Re: [PHP] PHP & ssi

2001-12-21 Thread Philip Olson
Try virtual() http://uk.php.net/virtual Something like: virtual('cgi-bin/ssirand.cgi?REGION=Sports'); regards, Philip Olson On Fri, 21 Dec 2001, Nick wrote: > Well the include line I needed was this: > > Shane > > > > On Friday 21 Dec 2001 5:45 pm,

Re: [PHP] register_globals not turning off

2001-12-13 Thread Philip Olson
what command? if you're using ini_set you can't. in this case it'll set the local value but it's of no consequence, register_globals has already done its thing before getting to the script. use of .htaccess is possible. regards, Philip Olson On Thu, 13 Dec 2001, Charlie

Re: [PHP] PHP 4.1.0 is_dir bug

2001-12-13 Thread Philip Olson
p/php4/NEWS regards, Philip Olson On Thu, 13 Dec 2001, Alok K. Dhir wrote: > > With PHP 4.1.0, all calls to is_dir which would have returned false now > report a "stat failed" warning as a bonus. Using @is_dir to quiet it > for the time being, but I'd imagine this

Re: [PHP] Installing PHP 4 on a RAQ3

2001-11-25 Thread Philip Olson
be of some use: http://www.php.net/manual/en/install.unix.php regards, Philip Olson On Sun, 25 Nov 2001, Phil Ewington wrote: > Hi, > > As I have only ever worked on a Windows platform, installing PHP & MySQL on > a RAQ3 is completely alien to me. I attempted to install the binari

Re: [PHP] Hour Calculation

2001-11-24 Thread Philip Olson
eps #1-2 would already involve unix timestamps. A hack can be created but let's try to avoid that :) regards, Philip Olson On Sat, 24 Nov 2001, neeraj wrote: > Hi List, > > !! Please help !! > My problem, > 1) My Start time for a xyz file is 11.15 am 14-11-2001 > 2)

Re: [PHP] What does &var mean ?

2001-11-22 Thread Philip Olson
> What does the "&" (ampersand) before the variable name mean ? It's called a reference, check out: http://www.php.net/manual/en/language.references.php regards, Philip Olson -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PRO

Re: [PHP] Address Standardization

2001-11-20 Thread Philip Olson
gards, Philip Olson On Tue, 20 Nov 2001, Jeff Lacy wrote: > Hello, > > Does anyone have a good function or ideas about address standardization? I > need some form of it in a web-app I am trying to write, but I don't know > where to begin. > > Thanks, > > Jeff > &

Re: [PHP] mail() function

2001-11-20 Thread Philip Olson
See: http://www.php.net/manual/en/function.mail.php an example lives there. The key here is that additional headers, such as From: will go in the optional additional_headers parameter. Regards, Philip Olson On Tue, 20 Nov 2001, Ben Clumeck wrote: > I am new to PHP. I am trying to spec

Re: [PHP] Conversion number two?

2001-11-20 Thread Philip Olson
perhaps you want to do the following: function foo($str) { return explode(' ',$str); } $required = foo('name address phone'); regards, Philip Olson On Tue, 20 Nov 2001, Brandon Lamb wrote: > Here is the php version > $required = array('name','

Re: [PHP] simple array tutorial wanted

2001-11-01 Thread Philip Olson
Hi Justin, That man page is pretty descriptive and contains many examples. It's sorta like a tutorial :) If there is information you (or anyone) feels is missing, please say so and it'll be looked into and perhaps added. Regards, Philip Olson On Fri, 2 Nov 2001, Justin Fr

Re: [PHP] Re: Where are lists of PHP's predefined constants andkeywords?

2001-10-31 Thread Philip Olson
k as expected: print $arr['mysql_connect']; print $arr['unset']; print $arr['empty']; Not suggesting these names be used as array keys though :) Regarding reserved words, they can be seen here: http://www.php.net/manual/en/reserved.php Regards, Philip Olson

Re: Re[2]: [PHP] split array in 2 halfs

2001-10-31 Thread Philip Olson
[1] => d [2] => e ) In the above, $second_half will be one larger then $arr if the number of elements is odd, otherwise they'll be equally sized halves. Using ceil() as opposed to floor() will make $second_half the smaller of the two. Regards, Philip Olson On Wed, 31 Oct 2001, Daniel

Re: [PHP] INPUT tag with default value

2001-10-23 Thread Philip Olson
This is not possible. Default values cannot be set with type=file as if it were it would be quite a security risk.A little more information on the capability of this html form element: http://www.blooberry.com/indexdot/html/tagpages/i/inputfile.htm And a related RFC : http://www.faqs.or

Re: [PHP] Re: require & include

2001-10-23 Thread Philip Olson
tus of pre 4.0.2 and is in the process of being updated. regards, Philip Olson On Tue, 23 Oct 2001, Steve Cayford wrote: > So both include() and require() *are* subject to conditional statements > in the code? Guess I missed that. > > Thanks. > > -Steve > > On Tuesday, Octo

Re: [PHP] associative array syntax question

2001-10-03 Thread Philip Olson
Hi Job. This works for me (and *should* always work) : $a = array('foo' => 'bar'); $b = array('b' => 'foo'); print $a[$b['b']]; // prints bar How _exactly_ are you calling it? (provide a short standalone ex) Does the above exam

Re: [PHP] file reading and textarea problem

2001-10-03 Thread Philip Olson
example : http://www.php.net/fread regards, Philip Olson On Wed, 3 Oct 2001, Nikola Veber wrote: > Hi ! > > I'm having a problem with the following : I have a log file on my site, that records >date, > time and the user's system. Each entry is placed in a new line. No

Re: [PHP] Pesky quotes

2001-10-03 Thread Philip Olson
n a string essentially does the same thing. Regards, Philip Olson On Wed, 3 Oct 2001, [iso-8859-1] René Fournier wrote: > A little problem with single quotes messing up an SQL SET statement... > > I can type single quotes, double quotes--it seems, any 'special' > character

Re: [PHP] Problem when displaying the $ character

2001-10-03 Thread Philip Olson
This assumption is incorrect, these are just variables that most likely contain unwanted whitespace, such as a \n. Consider using trim() beforehand. Maybe I misunderstand your question. Also, no need for "" when printing variables directly like that. echo $foo; Regards, Philip

Re: [PHP] Re: Free hosts, or Temp account...some thing

2001-10-02 Thread Philip Olson
sounds like it's time to repartition your HD, or get a new HD, or linux box ... install a flavor of linux and try it out locally. in the long run, this will be the most fun anyways :-) Regards, Philip Olson On Wed, 3 Oct 2001, ReDucTor wrote: > But that doesn't have an opt

RE: [PHP] named anchors and query strings

2001-10-02 Thread Philip Olson
Here's an example : http://www.php.net/manual/en/configuration.php?foo=bar#ini.include-path It works. Regards, Philip Olson On Tue, 2 Oct 2001, Ralph Guzman wrote: > Never had to do this, however I would think the correct way to be: > > > > try it. > -Origi

Re: [PHP] mysql_fetch_array() doesn't work

2001-09-26 Thread Philip Olson
a few words on this topic recently, can view them here : http://marc.theaimsgroup.com/?l=php-general&m=100152166602273 regards, Philip Olson On Thu, 27 Sep 2001, Web user wrote: > System: PHP4.06 + Mysql3.23.41 Win32 + Apache 1.3.20 Win32 + Win98 > > When PHP is running at the li

Re: [PHP] pirvate sites

2001-09-26 Thread Philip Olson
to cookie tutorials in there too. regards, Philip Olson On Thu, 27 Sep 2001, Murat wrote: > hi, > i think -i've read- private sites which has login scripts (have username and > password) are made using cookie. if this is true, how can find the > information about making like t

Re: [PHP] Removing Certain Key==>Val from an array...

2001-09-26 Thread Philip Olson
Here's one way : $bye = 'jennifer lopez'; foreach ($cart as $title => $value) { if (!strcasecmp($value,$bye)) { unset($cart[$title]); break; } } Btw, it's => not ==>, jennifer not jannifer :) regards, Philip Olson On Thu, 27 Sep 2001, Sijan Khadk

Re: [PHP] Variable variables

2001-09-26 Thread Philip Olson
s : $arr[foo] will create an error/warning here, $arr['foo'] will not. "$foo" isn't as pretty as $foo regards, Philip Olson On Wed, 26 Sep 2001, Richard Baskett wrote: > I can not figure out why this is not working! > > for ($j=0; $j<$resultNum; $j

RE: [PHP] Building Dynamic Value list using ohp

2001-09-26 Thread Philip Olson
; // apple and no Warning (quotes are good) Numerical arrays work fine in a string, such as "foo $array[0]". Maxim is referring to "foo $arr['a']" creating a parse error, one that looks like : Parse error: parse error, expecting `T_STRING' or `T_VARIABLE' o

RE: [PHP] display query results at random

2001-09-25 Thread Philip Olson
through accordingly. see : http://www.mysql.com/doc/M/a/Mathematical_functions.html for more details. regards, Philip Olson On Wed, 26 Sep 2001, Matthew Delmarter wrote: > Hi Lawrence, > > Thanks for your reply. > > I should clarify that I want to control where I output the resul

Re: [PHP] browser detection

2001-09-25 Thread Philip Olson
most use to you, it contains examples to do about anything with $HTTP_USER_AGENT. Also, check out the get_browser() function : http://www.php.net/manual/en/function.get-browser.php Although it takes a little work to get running :) Regards, Philip Olson On Tue, 25 Sep 2001, wm wrote: > hi

Re: [PHP] htmlspecialchars() backwards?

2001-09-25 Thread Philip Olson
See : http://www.php.net/manual/en/function.get-html-translation-table.php An example exists in there that does this. Regards, Philip Olson On Tue, 25 Sep 2001, Jay Paulson wrote: > hello- > > Is there a built in function that will reverse what htmlspecialchars() does > to

Re: [PHP] global variables

2001-09-24 Thread Philip Olson
$bar = 'abc'; function foo() { global $bar; $bar = 'def'; } foo(); echo $bar; // def http://www.php.net/manual/en/language.variables.scope.php regards, Philip Olson On Tue, 25 Sep 2001, Peter wrote: > Hi, > > I am have a function in which I have cre

Re: [PHP] "Warning: Undefined variable" when used locally, but fineon remote server

2001-09-24 Thread Philip Olson
inux, either "fix" the code (yeah!) or use the error_reporting() function to suppress the warnings. Strange that a free host would have it on, actually, it's kinda cool :) regards, Philip Olson On Mon, 24 Sep 2001, Justin Colson wrote: > I have recently installed Apache 1.3.2 a

Re: [PHP] Even more text document stuff!!

2001-09-24 Thread Philip Olson
file(). you should get comfortable with arrays too. also, look into stristr(). regards, Philip Olson On Mon, 24 Sep 2001, Kyle Smith wrote: > Is i possible to make PHP "CUT" all of the contents of a text document out of it and >make it into a variable? > > (yes i kno

Re: [PHP] Re: fopen, fread

2001-09-22 Thread Philip Olson
;Put a url contents into a string." fgets() is nice because you don't have to gets the entire file, sticking a break; in there during a "match" can be uber cool :-) If this is being done locally then of course don't go through http:// ... Regards, Philip Olson On Su

Re: [PHP] php website

2001-09-21 Thread Philip Olson
It's being worked on, go here : http://www.php.net/mirrors.php Replacing www with your county code (uk,us,au...) usually works too. For example, the uk mirror is uk.php.net regards, Philip Olson On Sat, 22 Sep 2001, Lukas wrote: > Hello, > > hey is it just me or is the

Re: [PHP] string conversion

2001-09-20 Thread Philip Olson
thing like the following may be appropriate as it'll check the end of $str for a desired ending : if (eregi('(gif|jpg|png|jpeg)$',$str)) { print 'yes, variable $str ends with gif, jpg, png or jpeg'; } warm regards, Philip Olson On Thu, 20 Sep 2001, Andras Kende w

Re: [PHP] delete element from an array

2001-09-19 Thread Philip Olson
Here's an example using unset() and array_splice(), notice the subtle difference : a [2] => c $bar = array('a','b','c'); $piece = array_splice ($bar, 1 ,1); print_r($piece); // [0] => b print_r($bar);// [0] => a [1] =

Re: [PHP] hrm..loop trouble

2001-09-19 Thread Philip Olson
Modulus will come in handy here, here's an example use : ". $row['foo'] ."\n"; if (($i++ % 5) === 4) { echo "\n\n"; } } ?> Regards, Philip Olson On Wed, 19 Sep 2001, Kurth Bemis wrote: > i'm

Re: [PHP] Undefined Variable in formular... what happens???

2001-09-18 Thread Philip Olson
'fruit']. http://uk.php.net/manual/en/language.variables.predefined.php Regards, Philip Olson On Tue, 18 Sep 2001, Ingo wrote: > hello > i am using win2000 xitami, php and access. so my problem is that the script > couldn't find the variable.. . > so i cant save the us

Re: [PHP] Array Question

2001-09-13 Thread Philip Olson
see array_slice() http://php.net/manual/en/function.array-slice.php regards, philip olson On Thu, 13 Sep 2001, dhardison wrote: > Hi, > I've got an array of items that I've sorted in descending order. I'd > like to select the first ten items only from the a

Re: [PHP] PHP Redirect in the middle of code?

2001-09-10 Thread Philip Olson
can also implement the delay (some of our users are slow readers :). Also, headers_sent() can be useful. I'd personally avoid output buffering for this. Regards, Philip Olson > > jason > > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubsc

Re: [PHP] 'Undefined Variable' help...

2001-09-04 Thread Philip Olson
http://www.php.net/manual/en/language.variables.external.php Configuration : error_reporting : http://www.php.net/manual/en/configuration.php#ini.error-reporting Hope that helps, good luck :) Regards, Philip Olson On Tue, 4 Sep 2001, Uchendu Nwachukwu wrote: > OK, I have a problem c

Re: [PHP] $str[0] vs $str{0} was : generate random ascii string

2001-09-01 Thread Philip Olson
$string = 'abc'; print $string[0]; // depreciated (might not work one day, when?) vs. print $string{0}; Both print 'a' though. Regards, Philip Olson -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional c

Re: [PHP] generate random ascii string

2001-09-01 Thread Philip Olson
rand ((float) microtime() * 100); $seed = TRUE; } // weak error checking mechanism if ($len < 1 || !is_numeric($len)) $len = 8; $chars_len = strlen($chars); for ($a=1; $a <= $len; $a++) { $tmp .= $chars{mt_rand(0,$chars_len)}; } return $tmp; } That was fun :) Regards

RE: [PHP] array search

2001-08-31 Thread Philip Olson
btw, you may want to search for a name surrounded by spaces as philip vs philips, jim vs jimmy, etc. probably other considerations as well, or maybe not :) philip On Fri, 31 Aug 2001, Philip Olson wrote: > try this : > > $people = array ('philip','sasheen',&

RE: [PHP] array search

2001-08-31 Thread Philip Olson
s now. print_r($matches); stristr is case insensitive, strstr is case sensitive. modify to suit your needs. regards, Philip Olson On Fri, 31 Aug 2001, Joseph Bannon wrote: > What about going the other way? Say I have a sentence... > > "Hi, my name is Bob." > > ...an

Re: [PHP] help again

2001-08-31 Thread Philip Olson
Sounds like you want to do : $guiness = 'Thick and Creamy!'; $beer= 'guiness'; print ${$beer}; // Thick and Creamy! Regards, Philip Olson On Fri, 31 Aug 2001, Nikola Veber wrote: > I am having big troubles here. I wrote this code just as it said in the m

Re: [PHP] help with strings...

2001-08-31 Thread Philip Olson
${$string{0}} = 'crazy'; print $a; // prints crazy Regards, Philip Olson On Fri, 31 Aug 2001, Papp Gyozo wrote: > > $GLOBALS[substr($string, 0, 1)] > or : > > $tmp = substr($string, 0, 1); > ${$tmp} = 'add whatever value you want'; > &

Re: [PHP] array search

2001-08-31 Thread Philip Olson
_name)),$good_names)) and, another good function is array_keys and array_search. see : http://www.php.net/array regards, Philip Olson On Fri, 31 Aug 2001, Andrey Hristov wrote: > from http://php.net/quickref.php > > $os = array ("Mac", "NT", &

Re: [PHP] The future of PHP

2001-08-31 Thread Philip Olson
looks bright. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]

Re: [PHP] PHP_SELF or REQUEST_URI within Function ?

2001-08-31 Thread Philip Olson
Warning if constant variable somekey is not defined (i.e. use 'quotes') $arr['key'] // Warning if key 'key' not defined See : http://www.php.net/manual/en/phpdevel-errors.php http://marc.theaimsgroup.com/?l=php-general&m=99486381324867

Re: [PHP] Suppressing error messages

2001-08-29 Thread Philip Olson
/manual/en/language.operators.errorcontrol.php example : if (@is_file($file_name)) Regards, Philip Olson On Wed, 29 Aug 2001, John Meyer wrote: > It seems to have slipped me little mind, but how do you suppress error messages? > > > -- > PHP General Mailing List (htt

Re: [PHP] foo? bar? wtf?

2001-08-29 Thread Philip Olson
see : http://foldoc.doc.ic.ac.uk/foldoc/foldoc.cgi?query=foo http://foldoc.doc.ic.ac.uk/foldoc/foldoc.cgi?query=bar pretty interesting :) regards, Philip Olson On Wed, 29 Aug 2001, Seb Frost wrote: > Why is it that every example uses foo and bar. In my head I put these > together

Re: [PHP] is_numeric for php3

2001-08-28 Thread Philip Olson
check? Regards, Philip On Tue, 28 Aug 2001, daniel james wrote: > do you mean, as in, > > if !is_integer($var) { > print("$var is not an integer"); > } > > --- Philip Olson <[EMAIL PROTECTED]> wrote: > > hi friends, > > > > Can someone p

Re: [PHP] two dimensional array or two arrays?

2001-08-28 Thread Philip Olson
Your $categoryarry is a 2d array, try : print_r($categoryarry); But, I think you want to do : $categories = array('Sasheen','Tom','Fred'); Now, if you do this : while(list($key,$value) = each($categories)) { print "$key : $value\n"; } You'll get : 0 : Sasheen 1 : Tom 2

Re: [PHP] Check if a word is in my string.

2001-08-28 Thread Philip Olson
see : http://www.php.net/strstr http://www.php.net/stristr Regards, Philip On Tue, 28 Aug 2001, Brandon Orther wrote: > Hello, > > I have a variable with a string in it. I want to check if in that > string a certain word is in it. Example > > $var = "This is a good sentence"; > >

[PHP] is_numeric for php3

2001-08-28 Thread Philip Olson
hi friends, Can someone post here "the" most efficient method to validate a variable as numeric? I see a ton of hacks/ways in the manual user comments under is_int, is_integer and is_numeric and would like to see just one or two good solid ones. And please, no regular expressions :) Regards, P

Re: [PHP] print_r question

2001-08-23 Thread Philip Olson
About the simplest way to accomplish what you want is : \newlines don't show up in browser but will in the source, check your html source and see how pretty it is (full of newlines). Here's an example : $string = "a\nb\nc\n"; print $string;(newlines in source) print nl2br($st

Re: [PHP] Is there a special character I here? (Regular Expressions)

2001-08-16 Thread Philip Olson
in length'; } Allowing spaces in $string is easy as : [a-z0-9 ] Also, some good variable and string functions exist : variables : http://php.net/manual/en/ref.var.php strings : http://php.net/manual/en/ref.strings.php Regards, Philip Olson On Thu, 16 Aug 2001, Brandon Orther wro

Re: [PHP] Upper or Lower Case

2001-08-07 Thread Philip Olson
Also keep in mind that sometimes spaces find their ways into the string and using trim() will get rid of them. Something like : if (strcasecmp('neo',trim($name)) == 0) { echo 'You chose our Neo line of goods, way to go!'; } Not to say spaces randomly attach to strings :-) but to be saf

Re: [PHP] converting numeric to a string

2001-08-07 Thread Philip Olson
Have a look here : http://php.net/manual/en/language.types.type-juggling.php http://php.net/manual/en/function.settype.php regards, philip On Tue, 7 Aug 2001, Don wrote: > Hi, > > I'm looking at the 'String' section of the online documentation. I cannot > find a function that converts

[PHP] Re: ULTIMATE TUTORIAL? (where)

2001-08-03 Thread Philip Olson
Hi Kyle, Yes, one such ultimate tutorial exists, it's called the PHP Manual. It's large and nice and contains many examples and user comments. If you find it scary, try out some less ultimate tutorials first. Go through the tutorials on devshed.com phpbuilder.com zend.com and related places,

Re: [PHP] George W.

2001-08-03 Thread Philip Olson
Please everyone, stop talking about this it's getting old. If you have issues with a list member, take it off the list. We, your fellow list members, don't want to hear about it. Publically making fun of someone isn't cool but rather, it's stupid. Regards, Philip -- PHP General Mailing L

Re: [PHP] Character newline (\n), How to

2001-08-01 Thread Philip Olson
A couple possible reasons : 1. Mixing \n and \n won't create a newline within your browser but rather it will within your html source code. Meaning, look at your html source and notice the newlines. 2. Using single quotes echo '\n'; will literally print '\n', in otherwords, it won't be e

Re: [PHP] PHP INSTALL (please, im too young to die!!!)

2001-08-01 Thread Philip Olson
Maybe you should just install a package, much easier. Check out : http://hotscripts.com/PHP/Scripts_and_Programs/Installation_Kits/ phpTriad and nusphere are popular, as are others. Once it's setup play with the configurations, etc. Usually mysql/apache/php will be installed. Regards, Philip

Re: [PHP] check if user exists

2001-08-01 Thread Philip Olson
See what this does within your code : $count = mysql_result($result,0); Should give you your count (number of users in db). Btw, don't escape single quotes in double quotes. In otherwords, the following is fine : $string = "I'm a nice string"; See : http://zend.com/zend/tut/usin

<    1   2   3   4   5   6   7   >