Re: [PHP] how do I use "<" and "<" with eval()?

2001-11-01 Thread John A. Grant
t that leaves you outside php mode, right? If the next thing after eval() is more php code, don't you have to enter php mode again like this: eval("?>$string zzz'; eval("?>$string); echo "hello"; is equivalent to:

[PHP] how do I use "<" and "<" with eval()?

2001-10-31 Thread John A. Grant
val()'d code on line 1 Do I have to use < and > in place of "<" & ">"? I tried several combinations, but I still get the same error. -- John A. Grant * I speak only for myself * (remove 'z' to reply) Radiation Geophysics, Geological Survey of

[PHP] Re: parsing a string

2001-10-31 Thread John A. Grant
ring = preg_replace("/\[(.*?\.)(gif|jpg),(.*?)\]/i", " alt=\"\\3\">", $string); > > echo $string; > > ?> Great!. I love it when I see stuff like this written by someone who knows regex better than I. The ability to insert the pieces that ar

Re: [PHP] parsing a string

2001-10-31 Thread John A. Grant
h HTML code Succinctly stated. >space+bird.gif"this is a bird" This is a possibility, but it requires a bit trickier code to recognize & split it. I was hoping for something easier to identify and parse, so maybe: #bird.gif|some text# That should be easy

Re: [PHP] parsing a string

2001-10-31 Thread John A. Grant
machine do all of the dirty work, not just in looking up the image size, but also formatting the output. For example, I'm already using functions like: emitlink("http://www.microsoft.com","Microsoft";); so I will have a similar function: emit

[PHP] Re: how to pass true/false or "no argument"

2001-10-29 Thread John A. Grant
"John A. Grant" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... [...] > How do I distinguish between false and "$xxx parameter not > passed"? Do I use isset()? Do I use ===? Well, I guess I should have done some home

[PHP] how to pass true/false or "no argument"

2001-10-29 Thread John A. Grant
=false; $xxx=null; $xxx=""; How do I distinguish between false and "$xxx parameter not passed"? Do I use isset()? Do I use ===? Thanks. -- John A. Grant * I speak only for myself * (remove 'z' to reply) Radiation Geophysics, Geological Survey of Canada, Ott

Re: [PHP] how to recognize local or server execution?

2001-10-27 Thread John A. Grant
uffixes and 'special page names. Perhaps it is only sufficient to test for $PHP_SELF and not $argc, but I threw in $argc==0 anyway. -- John A. Grant * I speak only for myself * (remove 'z' to reply) Radiation Geophysics, Geological Survey of Canada, Ottawa If you followup, please

[PHP] how to recognize local or server execution?

2001-10-26 Thread John A. Grant
ter="\r\n"; }else{ $delimiter="\n"; } and then my code looks like: print "hello$delimiter"; How can I do this? -- John A. Grant * I speak only for myself * (remove 'z' to reply) Radiation Geophysics, Geological Survey of Canada, Ottawa If

Re: [PHP] Re: is there a commandline php.exe interpreter?

2001-10-26 Thread John A. Grant
.php. Then I run a batch editor on them to replace links to *.php with links to corresponding *.html files. Thanks. -- John A. Grant * I speak only for myself * (remove 'z' to reply) Radiation Geophysics, Geological Survey of Canada, Ottawa If you followup, please do NOT e-mail me a c

[PHP] Re: is there a commandline php.exe interpreter?

2001-10-25 Thread John A. Grant
"John A. Grant" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > I've installed ActivePerl, which gives me a way to run .pl files, > i.e. : > c:\> perl someprogram.pl > > Does the Win32 php installation

Re: [PHP] = 0 and = "0"

2001-10-25 Thread John A. Grant
e) ... if(x==false) ... itt's always considered better to do this: if(x) ... if(!x) ... But PHP seems to require a direct comparison with false in certain situations. Are there any cases where you need to do a direct comparison with true? Are

Re: [PHP] how do i give optional arguments to functions??

2001-10-24 Thread John A. Grant
;t that be: function top($image=null) if ($image) -- John A. Grant * I speak only for myself * (remove 'z' to reply) Radiation Geophysics, Geological Survey of Canada, Ottawa If you followup, please do NOT e-mail me a copy: I will read it here -- PHP Genera

[PHP] Re: redirecting the browser

2001-10-24 Thread John A. Grant
ory.hts/tech/735399 Solution: http://www.builder.com/Authoring/Tagmania/011000/index.html The latter solution is very good because it covers all of the bases. -- John A. Grant * I speak only for myself * (remove 'z' to reply) Radiation Geophysics, Geological Survey of Canada, Ot

[PHP] is there a commandline php.exe interpreter?

2001-10-23 Thread John A. Grant
web server? I started to install it, but it looked like it was going to just install server stuff, so I cancelled it. -- John A. Grant * I speak only for myself * (remove 'z' to reply) Radiation Geophysics, Geological Survey of Canada, Ottawa If you followup, please do NOT e-mail

Re: [PHP] view *.php pages locally on NT?

2001-10-21 Thread John A. Grant
nding *.html pages in batch mode as follows: c:\> php index.php > index.html c:\> php about.php > about.html etc. and then run a batch search/replace program on the *.html files to change all links to .php pages to link to the newly-generated pages.

[PHP] Re: why does trim() remove NUL?

2001-10-19 Thread John A. Grant
rays, so you have to mark the end with \0. php arrays have a length attribute, so \0 terminator is unnecessary. -- John A. Grant * I speak only for myself * (remove 'z' to reply) Radiation Geophysics, Geological Survey of Canada, Ottawa If you followup, please do NOT e-mail me

[PHP] parsing a string

2001-10-18 Thread John A. Grant
ps img(filename,text) is more elegant, but it might need more skills than I have in using regex to recognize it and extract it. Also I need to figure out how to extract and echo the plain text around it. Any ideas are appreciated. Thanks. -- John A. Grant * I speak only for myself * (remo

[PHP] which regexp require preg_grep() and which can be used with ereg()?

2001-10-05 Thread John A. Grant
ot;\S",$buffer) to check for a blank or must I use preg_grep()or that. What specific things require preg_grep() to be used instead of ereg()? Thanks. -- John A. Grant * I speak only for myself * (remove 'z' to reply) Radiation Geophysics, Geological Survey of Canada, Ottawa If yo

[PHP] Re: read file twice or read into array once?

2001-10-05 Thread John A. Grant
at's killing you, not something > else. I realized it was insignificant amount of memory, but I wasn't sure about whether this was ok or not in a server environment. I will use file() and investigate further if it seems slow. Thanks. -- John A. Grant * I speak o

[PHP] accessing localtime array directly

2001-10-05 Thread John A. Grant
In Perl I have done this: $julianday=(localtime)[7]; Is there an equivalent syntax for PHP or do I just do: $now=localtime(); $julianday=$now[7]; I don't need it - I'm just curious about the syntax. -- John A. Grant * I speak only for myself * (remove 'z'

[PHP] Re: Submitting variables via /'s

2001-10-05 Thread John A. Grant
"Ashley M. Kirchner" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > I want to move away from > file.php?var1=1&var2=2&var3=3 > ...and go to > file.php/1/2/3 [...] Why? What's wrong

[PHP] read file twice or read into array once?

2001-10-04 Thread John A. Grant
uired entry: $n=$julianday % count($lines) I appreciate that this depends on the no. of lines in the file and the size of the file. What I'm looking for is opinions on whether the use of file() is more efficient than fgets(). It needs more memory, but it eliminates reading the file twice. Thank

Re: [PHP] newbie - some simple questions

2001-10-04 Thread John A. Grant
ss to them at the server level. Hmm, since the directory always has an index.html, clients will never see the filename anyway and could only run it by guessing at the name, so it's a small point. -- John A. Grant * I speak only for myself * (remove 'z' to reply) Radiat

[PHP] newbie - some simple questions

2001-10-02 Thread John A. Grant
roup, but I couldn't really follow the conversations. Is that group for discussing ways to implement a design template in php so that all pages have the same appearance? I guess that's what I'm doing with my mylib.php module - the functions dump out the same nav bars to every page. Tha