RE: [PHP] Getting part of a string...Was protecting a file via php

2003-09-17 Thread Steve Jackson
nged explorer. Steve Jackson Web Development and Marketing Manager Viola Systems Ltd. http://www.violasystems.com [EMAIL PROTECTED] Mobile +358 50 343 5159 > -Original Message- > From: Steve Jackson [mailto:[EMAIL PROTECTED] > Sent: 17. syyskuuta 2003 13:53 > To: 'PHP

RE: [PHP] Getting part of a string...Was protecting a file via php

2003-09-17 Thread Steve Jackson
Thanks to all so far. However I am still having problems I have directory outside the root with PDF's in it. The links to the PDF files are called successfully by this function in a page I call getlinks.php function do_non_root_links() { define('FILEDIR', '/home/.sites/144/site281/downloads/'); /

Re: [PHP] Getting part of a string...Was protecting a file via php

2003-09-16 Thread Curt Zirzow
* Thus wrote Jon Haworth ([EMAIL PROTECTED]): > Hi Steve, > > > $pfile = str_replace('get.php?file=','','$file'); > > $p = explode('.', $pfile); > > // How do I say look at the extension and put it into the switch? > > $extension = $p; > > // end of the bit I'm stuck on. > > At this point $p is a

Re: [PHP] Getting part of a string...Was protecting a file via php

2003-09-16 Thread Jason Wong
On Tuesday 16 September 2003 21:24, Jon Haworth wrote: > At this point $p is an array rather than a variable, so you'll need to get > the last element of $p.Try something like this: > > $p = explode('.', $pfile); > $extension = $p[sizeof($p)-1]; Better still, use array_pop(). -- Jason Wong -> G

Re: [PHP] Getting part of a string...Was protecting a file via php

2003-09-16 Thread Jurgens du Toit
If you use pathinfo($pfile), you'll get an array with the dirname, basename and extension... Jrgns -- <>< [EMAIL PROTECTED] 083 511 7932 "For those who believe no evidence is necessary. For those who don't, no evidence would suffice." -- PHP General Mailing List (http://www.php.net/) To unsubscri

Re: [PHP] Getting part of a string...Was protecting a file via php

2003-09-16 Thread Jon Haworth
Hi Steve, > $pfile = str_replace('get.php?file=','','$file'); > $p = explode('.', $pfile); > // How do I say look at the extension and put it into the switch? > $extension = $p; > // end of the bit I'm stuck on. At this point $p is an array rather than a variable, so you'll need to get the last e

[PHP] Getting part of a string...Was protecting a file via php

2003-09-16 Thread Steve Jackson
OK, After much headbanging I figured out the first part of my problem. I want to retrieve a file from behind the webroot and to do this I need to send headers. This should be a simple case of finding out what the file is called (its extension) and sending the headers via a switch depending on what

[PHP] getting part of a string

2003-07-08 Thread Micah Montoy
Anyone have a sure way of grabbing just the file name from a string that looks like this: C:/Documents and Settings/Bobo the Bugbear/My Documents/My Pictures/1.gif I would like to pull off, just the name "1.gif" or even better just "1" without the extension. I've been working on: $filevalue = s

Re: [PHP] Getting part of a string

2002-09-27 Thread Justin French
Assuming that it will always be in this format (/something/what you want/...), explode() the string by '/' into an array, and get the right element back. Enjoy Justin French on 28/09/02 1:23 AM, [EMAIL PROTECTED] ([EMAIL PROTECTED]) wrote: > > I've got a situation where I need to pull a s

RE: [PHP] Getting part of a string

2002-09-27 Thread Ford, Mike [LSS]
-Original Message- From: [EMAIL PROTECTED] To: [EMAIL PROTECTED] I've got a situation where I need to pull a string from a variable but I can't seem to get it figured out. I.e. value of $a = /realtor/Remax/Ed/files/ I need to get the string between the second and third / (slash) What

Re: [PHP] Getting part of a string

2002-09-27 Thread debbie_dyer
t: Friday, September 27, 2002 4:23 PM Subject: [PHP] Getting part of a string > > I've got a situation where I need to pull a string from a variable but I > can't seem to get it figured out. > > I.e. > > value of $a = /realtor/Remax/Ed/files/ > > I need

Re: [PHP] Getting part of a string

2002-09-27 Thread Marek Kilimajer
reg_match('^/[^/]*/([^/]*)/',$a, $match) $match[1] should contain what you need [EMAIL PROTECTED] wrote: >I've got a situation where I need to pull a string from a variable but I >can't seem to get it figured out. > >I.e. > >value of $a = /realtor/Remax/Ed/files/ > >I need to get the string be

[PHP] Getting part of a string

2002-09-27 Thread ed
I've got a situation where I need to pull a string from a variable but I can't seem to get it figured out. I.e. value of $a = /realtor/Remax/Ed/files/ I need to get the string between the second and third / (slash) What I need: Remax Thanks, Ed -- PHP General Mailing List (http://www.p

Re: [PHP] Getting part of a string

2001-01-20 Thread Website4S
In a message dated 21/01/2001 03:43:19 GMT Standard Time, [EMAIL PROTECTED] writes: << if( eregi( "^([^@]+)@([^@]+)$", $email, $match)) { $email_user = $match[1]; $email_domain = strtolower( $match[2]); echo "$email_user at $email_doma

Re: [PHP] Getting part of a string

2001-01-20 Thread Markus Fischer
On Sat, Jan 20, 2001 at 09:10:45PM -0500, [EMAIL PROTECTED] wrote : > I have a form which users enter their email address, once submitted I need a > way to chop it up and put it in lowercase. So that if a user submits > [EMAIL PROTECTED] I want PHP to throw out Website4S and then make the rest

[PHP] Getting part of a string

2001-01-20 Thread Website4S
Hi, I have a form which users enter their email address, once submitted I need a way to chop it up and put it in lowercase. So that if a user submits [EMAIL PROTECTED] I want PHP to throw out Website4S and then make the rest lowercase so I would get @aol.com I know how to get the string to lo