[PHP] LDAP_connect()

2003-08-02 Thread Ron Allen
Everytime I try to run this function it says that it is an undefined
function LDAP_connection



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



php-general Digest 2 Aug 2003 11:39:33 -0000 Issue 2212

2003-08-02 Thread php-general-digest-help

php-general Digest 2 Aug 2003 11:39:33 - Issue 2212

Topics (messages 158019 through 158039):

Re: A long float number.
158019 by: zavaboy

strings
158020 by: Anthony Ritter
158024 by: Curt Zirzow
158028 by: Anthony Ritter
158032 by: Curt Zirzow
158037 by: Anthony Ritter

Re: weird php error
158021 by: Jim Lucas
158035 by: Matt Giddings
158036 by: Matt Giddings

Test a zip file for validity
158022 by: Ivo Pletikosic
158023 by: Chris W. Parker
158025 by: Curt Zirzow

strange issue: cygwin- why can't I configure the php.ini ?
158026 by: kalmen
158034 by: Jason Wong

Verisign PFPRO API & PHP: How to ensure hitting "STOP" in the browser will not kill 
the transcation
158027 by: e
158029 by: Curt Zirzow

plPHP released.. yes PostgreSQL functions in PHP
158030 by: Joshua D. Drake
158033 by: Curt Zirzow

embedding php in C
158031 by: April

Pushing array onto array
158038 by: Hank TT

LDAP_connect()
158039 by: Ron Allen

Administrivia:

To subscribe to the digest, e-mail:
[EMAIL PROTECTED]

To unsubscribe from the digest, e-mail:
[EMAIL PROTECTED]

To post to the list, e-mail:
[EMAIL PROTECTED]


--
--- Begin Message ---
Thanks! number_format() fixed it!

"Bogdan Stancescu" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Keeping it on one line doesn't affect the calculations (as it
> shouldn't). Try using either sprintf() or number_format() for this
> purpose (the latter is generally preferred, but I don't know exactlt
> what you're after).
>
> Bogdan
>


--- End Message ---
--- Begin Message ---
In the following snippet, I'm trying to open and read a URL into the
variable $contents.
I'd like to use preg_replace() to return only part of that string beginning
with say - regional and ending with new - but I get the complete URL string
returned.

Thank you for any assistance.
Tony Ritter
...

http://weather.noaa.gov/pub/data/summaries/regional/ny/albany.txt";;
if (!($fp=fopen($theurl, "r")))
 {
  echo "Could not open the URL.";
  exit;
 }
$contents=fread($fp, 100);
$newtext= preg_replace("/.*?(regional.*new).*/","1",$contents);
fclose($fp);
echo $newtext;
?>



--- End Message ---
--- Begin Message ---
* Thus wrote Anthony Ritter ([EMAIL PROTECTED]):
> In the following snippet, I'm trying to open and read a URL into the
> variable $contents.
> I'd like to use preg_replace() to return only part of that string beginning
> with say - regional and ending with new - but I get the complete URL string
> returned.
>
> [...]
>
> $newtext= preg_replace("/.*?(regional.*new).*/","1",$contents);


This exact thing was talked about earlier today, with the subject
'Using eregi_replace()'.

http://marc.theaimsgroup.com/?t=10597485126&r=1&w=2

HTH,

Curt
-- 
"I used to think I was indecisive, but now I'm not so sure."
--- End Message ---
--- Begin Message ---
Curt Zirzow wrote in message:

> This exact thing was talked about earlier today, with the subject
> 'Using eregi_replace()'.


Right.

However, I've tried using the following code in which the text from the URL
is printed out completely and then I change the variable from $contents to
$text and using the line with preg_replace(), it still outputs the complete
text without the pattern match.

Any advice will be helpful.
Thank you.
TR


http://weather.noaa.gov/pub/data/summaries/regional/ny/albany.txt";;
if (!($fp=fopen($theurl, "r")))
 {
  echo "Could not open the URL.";
  exit;
 }
$contents=fread($fp, 100);
fclose($fp);
echo $contents;
echo "";
$text=$contents;
$newtext= preg_replace("!.*?(REGIONAL.*YORK).*!","$1",$text);
echo $newtext;  // outputs the same text as above
?>
..


--- End Message ---
--- Begin Message ---
* Thus wrote Anthony Ritter ([EMAIL PROTECTED]):
> Curt Zirzow wrote in message:
> 
> > This exact thing was talked about earlier today, with the subject
> > 'Using eregi_replace()'.
> 
> 
> Right.
> 
> However, I've tried using the following code in which the text from the URL
> is printed out completely and then I change the variable from $contents to
> $text and using the line with preg_replace(), it still outputs the complete
> text without the pattern match.
 
hm.. I sort of misunderstood, preg_replace isn't what you need. use
preg_match instead.

I did some testing you can see the code and results here:
http://zirzow.dyndns.org/html/php/tests/preg/parse_doc.php

> $newtext= preg_replace("!.*?(REGIONAL.*YORK).*!","$1",$text);
btw, there these should be single quotes ~~^  ^

or "\$1" so php doesn't expand the variable (even though its an
illagal php var name.)


HTH,

Curt
-- 
"I used to think I was indecisive, but now I'm not so sure

[PHP] Re: LDAP_connect()

2003-08-02 Thread Bogdan Stancescu
http://ro.php.net/manual/en/ref.ldap.php#ldap.requirements

Ron Allen wrote:
Everytime I try to run this function it says that it is an undefined
function LDAP_connection



--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] connecting access (*.mdb) database with PHP

2003-08-02 Thread pehepe php
how can I connect access database(*.mdb) with php?  what is the code?   I 
will be happy if you write php code.

Thank you!

_
Tired of spam? Get advanced junk mail protection with MSN 8. 
http://join.msn.com/?page=features/junkmail

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] connecting access (*.mdb) database with PHP

2003-08-02 Thread skate


> how can I connect access database(*.mdb) with php?  what is the code?   I
> will be happy if you write php code.
>
>


damn, i'd be happy if other would write my code too...

check out the COM connections in the manual. best place for you to start,
should be able to connect to most ms applications. i'm not sure about
connecting directly to an mdb file tho...




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Pushing array onto array

2003-08-02 Thread Andrew Brampton
Well I just coded up a very small example, and it pushing 1 array into the
other...

Check out: http://81.102.229.151/push.php and
http://81.102.229.151/push.phps

It works exactly how it should... However really the array isn't a 2
dimensional one, since PHP doesn't have them, its rather a array of arrays
which is roughly the same thing (and something not to worry about)...

If you need more help just email me
Andrew
- Original Message -
From: "Hank TT" <[EMAIL PROTECTED]>
To: "php-general" <[EMAIL PROTECTED]>
Sent: Saturday, August 02, 2003 7:58 AM
Subject: [PHP] Pushing array onto array


> In comparing Perl's push to array_push in "PHP Developer's Cookbook" (2/e,
> p. 76), the authors note that pushing an array onto another produces a
> two-dimensional array.  However, I have not been able to reproduce their
> example result, and php.net/array_push does not document this behavior.
>
> Just curious.
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] connecting access (*.mdb) database with PHP

2003-08-02 Thread Craig Roberts
Have a look for MyODBC. I've got Access talking to SQL easily, dont know if
it can be done the other way round.

Craig Roberts

"Skate" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
>
>
> > how can I connect access database(*.mdb) with php?  what is the code?
I
> > will be happy if you write php code.
> >
> >
>
>
> damn, i'd be happy if other would write my code too...
>
> check out the COM connections in the manual. best place for you to start,
> should be able to connect to most ms applications. i'm not sure about
> connecting directly to an mdb file tho...
>
>
>



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Re: LDAP_connect()

2003-08-02 Thread Craig Roberts
Have you enabled the module in php.ini?

Uncomment the line

extension=php_ldap.dll

in php.ini (windows..) I think LDAP support needs to be complied in on Linux
but I've never used it so cant say.

Craig Roberts

"Ron Allen" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Everytime I try to run this function it says that it is an undefined
> function LDAP_connection
>
>



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] connecting access (*.mdb) database with PHP

2003-08-02 Thread David Nicholson
Hello,

This is a reply to an e-mail that you wrote on Sat, 2 Aug 2003 at
15:31, lines prefixed by '>' were originally written by you.
> how can I connect access database(*.mdb) with php?  what is the
code?
>  I
> will be happy if you write php code.

Windows Control Panel > Administrative Tools > Data Sources (or
something like that!)

This window will let you setup an ODBC DSN for any mdb file.  You
should then be able to use PHPs ODBC functions to run queries on it
.

I have never tried this though, so apoligies if it does not work.

David.

--
phpmachine :: The quick and easy to use service providing you with
professionally developed PHP scripts :: http://www.phpmachine.com/

  Professional Web Development by David Nicholson
http://www.djnicholson.com/

QuizSender.com - How well do your friends actually know you?
 http://www.quizsender.com/
(developed entirely in PHP)

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Re: subtracting dates...

2003-08-02 Thread John Ryan
yeah, i was thinking that before i decided to post to the newsgroup. i
thought there was some simple way of doing it and id be wasting my time.
obviosuly not


"Craig Roberts" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Try something along the lines of
>
> if($current_MM < $MM) {
> $age = $calculatedage - 1;
> }
>
> you'll also need to do something like this with the day of the month if
the
> user's bday is in the current month.
> at least... i think that works out :$
> Craig Roberts
>
>
> "John Ryan" <[EMAIL PROTECTED]> wrote in message
> news:[EMAIL PROTECTED]
> > Hi,
> >
> > In mySQL, I store dates as -MM-DD, a standard DATE type. It stores
> users
> > date of births. I need to calculate in a PHP script, the users age from
> this
> > DOB. I get a PHP date in the same format as the mySQL and subtract,
which
> > returns the year rounded off. ie, it doesnt matter if your birthdays in
> june
> > of 1983 and the date is januray 2003, your age is still returned as 20,
> when
> > it should be 19.
> >
> > Does anyone know how can i get the right age?
> >
> >
>
>



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Re: subtracting dates...

2003-08-02 Thread Craig Roberts
Another idea (slightly simpler)...

how about using mktime(); to create a timestamp from your date info, and
subtract that from the current timestamp - leaving (i think) the person's
age in seconds...

Then just do some math...

hmm... is that really simpler? well it seemed it when i started typing

craig :)
"John Ryan" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> yeah, i was thinking that before i decided to post to the newsgroup. i
> thought there was some simple way of doing it and id be wasting my time.
> obviosuly not
>
>
> "Craig Roberts" <[EMAIL PROTECTED]> wrote in message
> news:[EMAIL PROTECTED]
> > Try something along the lines of
> >
> > if($current_MM < $MM) {
> > $age = $calculatedage - 1;
> > }
> >
> > you'll also need to do something like this with the day of the month if
> the
> > user's bday is in the current month.
> > at least... i think that works out :$
> > Craig Roberts
> >
> >
> > "John Ryan" <[EMAIL PROTECTED]> wrote in message
> > news:[EMAIL PROTECTED]
> > > Hi,
> > >
> > > In mySQL, I store dates as -MM-DD, a standard DATE type. It stores
> > users
> > > date of births. I need to calculate in a PHP script, the users age
from
> > this
> > > DOB. I get a PHP date in the same format as the mySQL and subtract,
> which
> > > returns the year rounded off. ie, it doesnt matter if your birthdays
in
> > june
> > > of 1983 and the date is januray 2003, your age is still returned as
20,
> > when
> > > it should be 19.
> > >
> > > Does anyone know how can i get the right age?
> > >
> > >
> >
> >
>
>



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Re: subtracting dates...

2003-08-02 Thread Paul Chvostek
On Sat, Aug 02, 2003 at 08:30:34PM +0100, John Ryan wrote:
>
> In mySQL, I store dates as -MM-DD, a standard DATE type. It stores users
> date of births. I need to calculate in a PHP script, the users age from this
> DOB. I get a PHP date in the same format as the mySQL and subtract, which
> returns the year rounded off. ie, it doesnt matter if your birthdays in june
> of 1983 and the date is januray 2003, your age is still returned as 20, when
> it should be 19.

The function you're probably looking for is floor().

> Does anyone know how can i get the right age?

One quick way would be simple subtraction:

  $old = "1973-06-02";
  $new = "2003-08-02";
  $year = 60*60*24*365.25; // seconds in a year
  $age = strtotime($new) - strtotime($old);
  print "Age in years: " . floor($age / $year) . "\n";

But you'll run into infrequent problems surrounding leap years.  I'm
sure there's a more accurate way to do this, perhaps even using MySQL's
somewhat more advanced (and less timestamp-centric) date calculation
functions, but this is what I can come up with on short notice.

Note that strtotime will give NEGATIVE TIMESTAMPS for dates earlier than
Jan 1st 1970 at midnight GMT, so this still works for folks over 33.  ;)

-- 
  Paul Chvostek <[EMAIL PROTECTED]>
  it.canadahttp://www.it.ca/
  Free PHP web hosting!http://www.it.ca/web/


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Multiple targets with fscanf

2003-08-02 Thread Denis 'Alpheus' Cahuk
Dan Anderson wrote:

Thanks a lot.
   

hehe no thanks needed.  Just remember to read up on the functions so
you'll know how they work.  ;-)
-Dan

 

I've found some bugs there too, so dont worry. Like the 
...($li_tag_start_position + 4), ($li_tag_end_position + 4)...
It actually has to be (4 + $li_tag_start_position), 
($li_tag_end_position - $li_tag_start_position - 4)

But thanks anyway :D



--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] subtracting dates...

2003-08-02 Thread John Ryan
Hi,

In mySQL, I store dates as -MM-DD, a standard DATE type. It stores users
date of births. I need to calculate in a PHP script, the users age from this
DOB. I get a PHP date in the same format as the mySQL and subtract, which
returns the year rounded off. ie, it doesnt matter if your birthdays in june
of 1983 and the date is januray 2003, your age is still returned as 20, when
it should be 19.

Does anyone know how can i get the right age?



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Re: subtracting dates...

2003-08-02 Thread Craig Roberts
Try something along the lines of

if($current_MM < $MM) {
$age = $calculatedage - 1;
}

you'll also need to do something like this with the day of the month if the
user's bday is in the current month.
at least... i think that works out :$
Craig Roberts


"John Ryan" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Hi,
>
> In mySQL, I store dates as -MM-DD, a standard DATE type. It stores
users
> date of births. I need to calculate in a PHP script, the users age from
this
> DOB. I get a PHP date in the same format as the mySQL and subtract, which
> returns the year rounded off. ie, it doesnt matter if your birthdays in
june
> of 1983 and the date is januray 2003, your age is still returned as 20,
when
> it should be 19.
>
> Does anyone know how can i get the right age?
>
>



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Pushing array onto array

2003-08-02 Thread Curt Zirzow
* Thus wrote Andrew Brampton ([EMAIL PROTECTED]):
> Well I just coded up a very small example, and it pushing 1 array into the
> other...
> 
> Check out: http://81.102.229.151/push.php and
> http://81.102.229.151/push.phps
> 
> It works exactly how it should... However really the array isn't a 2
> dimensional one, since PHP doesn't have them, its rather a array of arrays
> which is roughly the same thing (and something not to worry about)...

A 2 demensional array is an array of arrays.

Curt
-- 
"I used to think I was indecisive, but now I'm not so sure."

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re[2]: [PHP] Opinions on Micro$oft .NET

2003-08-02 Thread Burhan Khalid
On Thursday, July 31, 2003, 9:13:03 PM, John wrote:

JWH> Jay Paulson wrote:
>> The company I work for just got bought out by a larger company.  The larger company 
>> uses .NET from Micro$oft. I of course use all open source stuff for our web sites 
>> and now the new company wants
>> to come in and pretty much blow away everything I have done and use their .NET 
>> setup.


JWH> First I'd quit referring to it as Micro$oft if you want to be taken 
JWH> seriously. You should be professional about this. If the new company 
JWH> wants to use a .NET solution, then you should begin learning a .NET 
JWH> language.

I agree completely with the good captain here. Its very unprofessional
to use Micro$oft. You might has well start saying you are "1337"
(don't ask me how long it took me to figure that one out).

Personally, I find that people that tend to hang on to one particular
toolset ... two things happen to them. Either they become extremely
proficient and extremely valuable, or they are yesterday's news. This
is true for just about any computer related language/platform etc.
that I can think of.

I am currently in a situation where I have been hired to develop a few
webservices for a client. At first, I looked at PHP and XML-RPC, since
PHP was what I was programming in currently and it was the freshest
thing in my mind. After reasearching the topic, I found out that _for
my client_ it was better to go with .NET.  After considerable reading
at the local technicaly library, a few hundred in books, and a lot of
googling and asking around, I found out the exact pros and cons of
using .NET, and I presented these to my client (during the prelim
stages).

The bottom line is, unless you start thinking in terms of your client
(in this case, your new company) and start to figure out how you can
become a more important asset to them, you will quickly find yourself
(depending on your company), either denied promotions, projects, etc.
... or in this day and age, you might just get the boot.

As for myself, I am well on my way to learning .NET's webservice
particulars, and finding that C# can be a "Good Thing". I cannot
attest to any performance claims, since my personal projects have been
on the "hello world"-type scale, but alot of reports floating around
on the net suggest that -- with the proper hardware configuration --
.NET-based platforms are quite reliable and speedy.

Just my $0.02 or whatever $0.02 is in euros.

-- 
Regards,
Burhan Khalid
phplist[at]meidomus[dot]com
http://www.meidomus.com


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] RE: [PHP-DB] subtracting dates...

2003-08-02 Thread Ryan Marks
I found this code at Google's cached version of the manual for the
date() function:
http://216.239.37.104/search?q=cache:kq0aNfZeEp8J:www.php.net/date+diffe
rence+two+date+site:www.php.net&hl=en&ie=UTF-8

This code only returned the number of hours, minutes, and seconds
between the two points in time.  Now it returns years and days as well
as the left over time.  The script also used the mod operator (%) to
find the remaining days after determining the year and it would not
calculate correctly.  For example, if I compared yesterday, three years
ago(08-01-00) and today (08-02-03) at noon for both days, I would get a
difference of 3 years.  No I am using while loops subtracting whole
years to find the number of days that remain.  The same is true for
subtracting days, hours and minutes.

CODE:
 31536000){
$r -= 31536000;
}
$dd=floor($r / 86400);
while ($r > 86400){
$r -= 86400;
}
$hh=floor($r/3600);
if ($hh<=9) $hh="0".$hh;  //adds a leading 0 if less than 10
while ($r > 3600){
$r -= 3600;
}
$mm=floor($r/60);
if ($mm<=9) $mm="0".$mm; //adds a leading 0 if less than 10
while ($r > 60){
$r -= 60;
}
$ss=$r ;
if ($ss<=9) $ss="0".$ss; //adds a leading 0 if less than 10
$retval="$yy year(s), $dd day(s) $hh:$mm:$ss";
return $retval;
}

?>


OUTPUT:
19 year(s), 229 day(s) 05:22:01

Hope this helps,
Ryan Marks

-Original Message-
From: John Ryan [mailto:[EMAIL PROTECTED] 
Sent: Saturday, August 02, 2003 2:31 PM
To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
Subject: [PHP-DB] subtracting dates...


Hi,

In mySQL, I store dates as -MM-DD, a standard DATE type. It stores
users date of births. I need to calculate in a PHP script, the users age
from this DOB. I get a PHP date in the same format as the mySQL and
subtract, which returns the year rounded off. ie, it doesnt matter if
your birthdays in june of 1983 and the date is januray 2003, your age is
still returned as 20, when it should be 19.

Does anyone know how can i get the right age?



-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Multiple targets with fscanf

2003-08-02 Thread Dan Anderson
> I've found some bugs there too, so dont worry. Like the 

lol...sorry but it was a quick reply...

-dan


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] subtracting dates...

2003-08-02 Thread Curt Zirzow
* Thus wrote John Ryan ([EMAIL PROTECTED]):
> Hi,
> 
hello ryan,

> In mySQL, I store dates as -MM-DD, a standard DATE type. It stores users
> date of births. I need to calculate in a PHP script, the users age from this
> DOB. I get a PHP date in the same format as the mySQL and subtract, which
> returns the year rounded off. ie, it doesnt matter if your birthdays in june
> of 1983 and the date is januray 2003, your age is still returned as 20, when
> it should be 19.
> 
> Does anyone know how can i get the right age?

To get a real age of someone you would use seconds, but since the actual
count of seconds get messed up on leap years (through the convertion
from seconds to years),  I approached it with the method most people
calculate ages.

Most people first look at the year and find the differnce, then if
the month/day hasn't come around you subtract one; alas the common
calculation for age.

Here is the code to demonstrate that logic:


$dob = split('-', '1980-12-1');
$now = split('-', date('Y-m-d'));

// we are either this age or one less
$age = $now[0] - $dob[0];

// have we gotten to the month of in dob?
if ($now[1] < $dob[1]) {

   // no, so we are technically a year less.
   $age--;

// If we're in the month,  has the day come yet?
} elseif ($now[1] = $dob[1] && $now[2] < $now[3]) {

   // no, still a few more days.
   $age--;
}

// your age is proper, in day to day usage.

/*
  Note:
  
  instead of the if () elseif() you can use
  if (mktime(0,0,0,$now[1],$now[2]) < mktime(0,0,0,$dob[1],$dob[2])) {
$age--;
  }

*/


HTH, 

Curt
-- 
"I used to think I was indecisive, but now I'm not so sure."

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Trouble with Session var

2003-08-02 Thread James Johnson
Hello,

This one has me stumped.

I'm setting a session var to a value returned from a query, then redirecting
to another page. I get the following error on the second page:

Notice: Undefined index: sv_adCatText 

On the page that sets the session var, I can do an echo of
$HTTP_SESSION_VARS['sv_adCatText'] and it prints the var fine. If I do a
var_dump($HTTP_SESSION_VARS); I can see all of the session vars, except this
one.

Is there a limit or something to the number of Session vars that can be
used? I've even tried setting a Session var called "foo" and that doesn't
work.

Thanks,
James

Here's the code:

First Page:



Second Page:




--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] Trouble with Session var

2003-08-02 Thread James Johnson
DOH! Nevermind, I mis-spelled session_start().

:(
-Original Message-
From: James Johnson [mailto:[EMAIL PROTECTED] 
Sent: Saturday, August 02, 2003 4:19 PM
To: [EMAIL PROTECTED]
Subject: [PHP] Trouble with Session var


Hello,

This one has me stumped.

I'm setting a session var to a value returned from a query, then redirecting
to another page. I get the following error on the second page:

Notice: Undefined index: sv_adCatText 

On the page that sets the session var, I can do an echo of
$HTTP_SESSION_VARS['sv_adCatText'] and it prints the var fine. If I do a
var_dump($HTTP_SESSION_VARS); I can see all of the session vars, except this
one.

Is there a limit or something to the number of Session vars that can be
used? I've even tried setting a Session var called "foo" and that doesn't
work.

Thanks,
James

Here's the code:

First Page:



Second Page:




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] preg_match

2003-08-02 Thread Michael Temeschinko
Hello,

I would like to split a String containing ingredience with additional 
assigned footnotes...

my problem I only get the first ingredience ($zutat at line 32 has only 
one times the awaited value) but the print on line 29 shows me that the 
value of $zutat is right at this point.

what's wrong 

  1 
  2
  3 $products_ingredience = 'Gersten-Grütze²*, Gerstenmehl²*, 
Haferflocken*, Gemüse 12 % (Lauch*, Möhren*, Zwiebeln*), Haferkleie*, 
Steinsalz, Petersilie*, Kartoffelstärke*, Hefeextrakt, Sellerieblatt*, 
Kurkuma*, Muskatnuß*, Pfeffer*, Liebstöckl*';
  4
  5 ArtikelZutaten ($products_ingredience);
  6
  7
  8 function ArtikelZutaten($products_ingredience) {
  9
 10
 11 print "\n\n\n$products_ingredience)";
 12 $Zutaten = explode(",", $products_ingredience);
 13
 14 foreach ($Zutaten as $zutat) {
 15 if (preg_match("/\²/", $zutat))
 16 $FussnoteID = 2;
 17 else
 18 $FussnoteID = '';
 19
 20 if (preg_match("/¹/", $zutat))
 21 $FussnoteID = 1;
 22
 23 if (preg_match("/\*/", $zutat))
 24 $kbA = 1;
 25 else
 26 $kbA = 0;
 27
 28 preg_match("/\b.*\b/", $zutat, $matches);
 29 print "\n-->>$zutat";
 30 $zutat = $matches[0];
 31
 32 print "\nZutat $zutat FussnotenID $FussnoteID kbA $kbA";
 33
 34 }
 35
 36 }
 37
 38 ?>



mfg - micha

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


php-general Digest 2 Aug 2003 23:40:47 -0000 Issue 2213

2003-08-02 Thread php-general-digest-help

php-general Digest 2 Aug 2003 23:40:47 - Issue 2213

Topics (messages 158040 through 158060):

Re: LDAP_connect()
158040 by: Bogdan Stancescu
158045 by: Craig Roberts

connecting access (*.mdb) database with PHP
158041 by: pehepe php
158042 by: skate
158044 by: Craig Roberts
158046 by: David Nicholson

Re: Pushing array onto array
158043 by: Andrew Brampton
158053 by: Curt Zirzow

subtracting dates...
158047 by: John Ryan
158048 by: Craig Roberts
158049 by: John Ryan
158050 by: Craig Roberts
158051 by: Paul Chvostek
158057 by: Curt Zirzow

Re: Multiple targets with fscanf
158052 by: Denis 'Alpheus' Cahuk
158056 by: Dan Anderson

Re: [PHP-DB] subtracting dates...
158054 by: Ryan Marks

Re: Opinions on Micro$oft .NET
158055 by: Burhan Khalid

Trouble with Session var
158058 by: James Johnson
158059 by: James Johnson

preg_match
158060 by: Michael Temeschinko

Administrivia:

To subscribe to the digest, e-mail:
[EMAIL PROTECTED]

To unsubscribe from the digest, e-mail:
[EMAIL PROTECTED]

To post to the list, e-mail:
[EMAIL PROTECTED]


--
--- Begin Message ---
http://ro.php.net/manual/en/ref.ldap.php#ldap.requirements

Ron Allen wrote:
Everytime I try to run this function it says that it is an undefined
function LDAP_connection


--- End Message ---
--- Begin Message ---
Have you enabled the module in php.ini?

Uncomment the line

extension=php_ldap.dll

in php.ini (windows..) I think LDAP support needs to be complied in on Linux
but I've never used it so cant say.

Craig Roberts

"Ron Allen" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Everytime I try to run this function it says that it is an undefined
> function LDAP_connection
>
>


--- End Message ---
--- Begin Message ---
how can I connect access database(*.mdb) with php?  what is the code?   I 
will be happy if you write php code.

Thank you!

_
Tired of spam? Get advanced junk mail protection with MSN 8. 
http://join.msn.com/?page=features/junkmail

--- End Message ---
--- Begin Message ---


> how can I connect access database(*.mdb) with php?  what is the code?   I
> will be happy if you write php code.
>
>


damn, i'd be happy if other would write my code too...

check out the COM connections in the manual. best place for you to start,
should be able to connect to most ms applications. i'm not sure about
connecting directly to an mdb file tho...



--- End Message ---
--- Begin Message ---
Have a look for MyODBC. I've got Access talking to SQL easily, dont know if
it can be done the other way round.

Craig Roberts

"Skate" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
>
>
> > how can I connect access database(*.mdb) with php?  what is the code?
I
> > will be happy if you write php code.
> >
> >
>
>
> damn, i'd be happy if other would write my code too...
>
> check out the COM connections in the manual. best place for you to start,
> should be able to connect to most ms applications. i'm not sure about
> connecting directly to an mdb file tho...
>
>
>


--- End Message ---
--- Begin Message ---
Hello,

This is a reply to an e-mail that you wrote on Sat, 2 Aug 2003 at
15:31, lines prefixed by '>' were originally written by you.
> how can I connect access database(*.mdb) with php?  what is the
code?
>  I
> will be happy if you write php code.

Windows Control Panel > Administrative Tools > Data Sources (or
something like that!)

This window will let you setup an ODBC DSN for any mdb file.  You
should then be able to use PHPs ODBC functions to run queries on it
.

I have never tried this though, so apoligies if it does not work.

David.

--
phpmachine :: The quick and easy to use service providing you with
professionally developed PHP scripts :: http://www.phpmachine.com/

  Professional Web Development by David Nicholson
http://www.djnicholson.com/

QuizSender.com - How well do your friends actually know you?
 http://www.quizsender.com/
(developed entirely in PHP)
--- End Message ---
--- Begin Message ---
Well I just coded up a very small example, and it pushing 1 array into the
other...

Check out: http://81.102.229.151/push.php and
http://81.102.229.151/push.phps

It works exactly how it should... However really the array isn't a 2
dimensional one, since PHP doesn't have them, its rather a array of arrays
which is roughly the same thing (and something not to worry about)...

If you need more help just email me
Andrew
- Original Message -
From: "Hank TT" <[EMAIL PROTECTED]>
To: "php-general" <[EMAIL PROTECTED]>
Sent: Saturday, August 02, 2003 7:58 AM
Subject: [PHP] Pushing array onto array


> I

Re: [PHP] Trouble with Session var

2003-08-02 Thread Curt Zirzow
* Thus wrote James Johnson ([EMAIL PROTECTED]):
> Hello,

hello james.

> 
> Is there a limit or something to the number of Session vars that can be
> used? I've even tried setting a Session var called "foo" and that doesn't
> work.

None that php enforces, only the operating system's filesystem and
the sanity of passing around  2MB of session data :)


>   $row_GetCatText= mysql_fetch_assoc($GetCatText);
>   $HTTP_SESSION_VARS['sv_adCatText'] = $row_GetCatText['category'];
>   if($HTTP_SESSION_VARS['sv_adCatText'] == "Books"){
>   header("Location: " . "CreateAdBook.php");
>   exit;
>   }else{
>   header("Location: " . "CreateAdNonBook.php");

These location headers should be using an absolute URI
(http://server/path/to/file.php)

As for your session problem, I'm not entirely sure but one
recommendation would be to ensure that a 'Connection: close' header
is sent to the client also. 


Curt
-- 
"I used to think I was indecisive, but now I'm not so sure."

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] subtracting dates...

2003-08-02 Thread John Ryan
yeah, thats the code i wrote myself (nearly). it gets the job done.
thanks

"Curt Zirzow" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> * Thus wrote John Ryan ([EMAIL PROTECTED]):
> > Hi,
> >
> hello ryan,
>
> > In mySQL, I store dates as -MM-DD, a standard DATE type. It stores
users
> > date of births. I need to calculate in a PHP script, the users age from
this
> > DOB. I get a PHP date in the same format as the mySQL and subtract,
which
> > returns the year rounded off. ie, it doesnt matter if your birthdays in
june
> > of 1983 and the date is januray 2003, your age is still returned as 20,
when
> > it should be 19.
> >
> > Does anyone know how can i get the right age?
>
> To get a real age of someone you would use seconds, but since the actual
> count of seconds get messed up on leap years (through the convertion
> from seconds to years),  I approached it with the method most people
> calculate ages.
>
> Most people first look at the year and find the differnce, then if
> the month/day hasn't come around you subtract one; alas the common
> calculation for age.
>
> Here is the code to demonstrate that logic:
>
>
> $dob = split('-', '1980-12-1');
> $now = split('-', date('Y-m-d'));
>
> // we are either this age or one less
> $age = $now[0] - $dob[0];
>
> // have we gotten to the month of in dob?
> if ($now[1] < $dob[1]) {
>
>// no, so we are technically a year less.
>$age--;
>
> // If we're in the month,  has the day come yet?
> } elseif ($now[1] = $dob[1] && $now[2] < $now[3]) {
>
>// no, still a few more days.
>$age--;
> }
>
> // your age is proper, in day to day usage.
>
> /*
>   Note:
>
>   instead of the if () elseif() you can use
>   if (mktime(0,0,0,$now[1],$now[2]) < mktime(0,0,0,$dob[1],$dob[2])) {
> $age--;
>   }
>
> */
>
>
> HTH,
>
> Curt
> --
> "I used to think I was indecisive, but now I'm not so sure."



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Pushing array onto array

2003-08-02 Thread Curt Zirzow
* Thus wrote Andrew Brampton ([EMAIL PROTECTED]):
> No there is a difference...
> 
> Take the example
> [ [a, b, c] , [ d, e, f] ]
> In a 2 dimensional array those values would be stored adjacent in memory...
> ie
> a b c d e f
> 
> In a Array of Arrays, the first and 2nd elements would be pointers, to where
> the [a, b, c], and [d, e, f] arrays are actually kept... ie
> 0 1 2 3 4 5 6 7
> 2 3 a b c d e f
> but this can all depend on the compiler, and the language construct... But
> its best to recognise a difference even if its really small...

how they are aligned in memory doesn't make them different in what
they are. Either way you still have a 2 dimential matrix.

> 
> and in PHP it can get even more confusing with its non strict typing, and
> un-fixed size arrays etc...

Some would argue this. PHP makes it easier for the programmer, so
he doesn't have to worry about type differences, memory allocation
and lower level access.  The programmer just needs to assign a
variable and poof... it is created.

> 
> Andrew
> - Original Message -
> From: "Curt Zirzow" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Saturday, August 02, 2003 11:06 PM
> Subject: Re: [PHP] Pushing array onto array
> 
> 
> > * Thus wrote Andrew Brampton ([EMAIL PROTECTED]):
> > >
> > > It works exactly how it should... However really the array isn't a 2
> > > dimensional one, since PHP doesn't have them, its rather a array of
> arrays
> > > which is roughly the same thing (and something not to worry about)...
> >
> > A 2 demensional array is an array of arrays.


Curt
-- 
"I used to think I was indecisive, but now I'm not so sure."

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Re: preg_match

2003-08-02 Thread Lee Doolan
> "Michael" == Michael Temeschinko <[EMAIL PROTECTED]> writes:

Michael> Hello,
Michael> I would like to split a String containing ingredience with additional
Michael> assigned footnotes...

Michael> my problem I only get the first ingredience ($zutat at line 32 has
Michael> only one times the awaited value) but the print on line 29 shows me
Michael> that the value of $zutat is right at this point.

Michael> what's wrong 

Michael>1 2
Michael>3 $products_ingredience = 'Gersten-Grütze²*, Gerstenmehl²*,
Michael> Haferflocken*, Gemüse 12 % (Lauch*, Möhren*, Zwiebeln*), Haferkleie*,
Michael> Steinsalz, Petersilie*, Kartoffelstärke*, Hefeextrakt, Sellerieblatt*,
Michael> Kurkuma*, Muskatnuß*, Pfeffer*, Liebstöckl*';
Michael>4
Michael>5 ArtikelZutaten ($products_ingredience);
Michael>6
Michael>7
Michael>8 function ArtikelZutaten($products_ingredience) {
Michael>9
Michael>   10
Michael>   11 print "\n\n\n$products_ingredience)";
Michael>   12 $Zutaten = explode(",", $products_ingredience);
Michael>   13
Michael>   14 foreach ($Zutaten as $zutat) {
Michael>   15 if (preg_match("/\²/", $zutat))
Michael>   16 $FussnoteID = 2;
Michael>   17 else
Michael>   18 $FussnoteID = '';
Michael>   19
Michael>   20 if (preg_match("/¹/", $zutat))
Michael>   21 $FussnoteID = 1;
Michael>   22
Michael>   23 if (preg_match("/\*/", $zutat))
Michael>   24 $kbA = 1;
Michael>   25 else
Michael>   26 $kbA = 0;
Michael>   27
Michael>   28 preg_match("/\b.*\b/", $zutat, $matches);
Michael>   29 print "\n-->>$zutat";
Michael>   30 $zutat = $matches[0];
Michael>   31
Michael>   32 print "\nZutat $zutat FussnotenID $FussnoteID kbA $kbA";
Michael>   33
Michael>   34 }
Michael>   35
Michael>   36 }
Michael>   37
Michael>   38 ?>

what do you get if you 
  print "\nmatches matches..."; var_dump($matches);

right after line 32?

-- 
no toll on the internet; there are paths of many kinds;
whoever passes this portal will travel freely in the world

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Pushing array onto array

2003-08-02 Thread Hank TT
Well, I might have been more specific about their example, since not
everyone has the book.  An excerpt below (so I don't need to retype all the
names of characters and foul creatures from the Lord of the Rings):

---
$arr1 = array('G', 'R', 'Sr');
$arr2 = array('N', 'Su', 'O');

$arr3 = array_push($arr1, $arr2);

print $arr3[3][1];
//prints Su
---

Weird usage







- Original Message -
From: "Andrew Brampton" <[EMAIL PROTECTED]>
To: "Hank TT" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Saturday, August 02, 2003 2:09 PM
Subject: Re: [PHP] Pushing array onto array


> Well I just coded up a very small example, and it pushing 1 array into the
> other...
>
> Check out: http://81.102.229.151/push.php and
> http://81.102.229.151/push.phps
>
> It works exactly how it should... However really the array isn't a 2
> dimensional one, since PHP doesn't have them, its rather a array of arrays
> which is roughly the same thing (and something not to worry about)...
>
> If you need more help just email me
> Andrew








-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Pushing array onto array

2003-08-02 Thread Jason Wong
On Sunday 03 August 2003 13:02, Hank TT wrote:
> Well, I might have been more specific about their example, since not
> everyone has the book.  An excerpt below (so I don't need to retype all the
> names of characters and foul creatures from the Lord of the Rings):
>
> ---
> $arr1 = array('G', 'R', 'Sr');
> $arr2 = array('N', 'Su', 'O');
>
> $arr3 = array_push($arr1, $arr2);
>
> print $arr3[3][1];
> //prints Su
> ---

I don't see how your example could work. array_push() does NOT return an 
array. The results of array_push() is placed in the first argument -- in this 
case $arr1.

> Weird usage

Think of it like this -- it adds the 2nd array onto the 1st array.

It does NOT add the *contents* of the 2nd array to the 1st array -- for that 
you would probably use array_merge().

Do a print_r($arr1), it might help you visualise what happens.

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
--
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
--
/*
It is now pitch dark.  If you proceed, you will likely fall into a pit.
*/


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] preg_match

2003-08-02 Thread Hank TT
Either of these should work:

preg_match("/\b.*\b/", trim($zutat), $matches);
preg_match("/\b.+\b/", $zutat, $matches);

I'll leave the why to someone else :)


- Original Message -
From: "Michael Temeschinko" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Saturday, August 02, 2003 7:55 PM
Subject: [PHP] preg_match


> Hello,
>
> I would like to split a String containing ingredience with additional
> assigned footnotes...
>
> my problem I only get the first ingredience ($zutat at line 32 has only
> one times the awaited value) but the print on line 29 shows me that the
> value of $zutat is right at this point.
>
> what's wrong 
>
>1 2
>3 $products_ingredience = 'Gersten-Grütze²*, Gerstenmehl²*,
> Haferflocken*, Gemüse 12 % (Lauch*, Möhren*, Zwiebeln*), Haferkleie*,
> Steinsalz, Petersilie*, Kartoffelstärke*, Hefeextrakt, Sellerieblatt*,
> Kurkuma*, Muskatnuß*, Pfeffer*, Liebstöckl*';
>4
>5 ArtikelZutaten ($products_ingredience);
>6
>7
>8 function ArtikelZutaten($products_ingredience) {
>9
>   10
>   11 print "\n\n\n$products_ingredience)";
>   12 $Zutaten = explode(",", $products_ingredience);
>   13
>   14 foreach ($Zutaten as $zutat) {
>   15 if (preg_match("/\²/", $zutat))
>   16 $FussnoteID = 2;
>   17 else
>   18 $FussnoteID = '';
>   19
>   20 if (preg_match("/¹/", $zutat))
>   21 $FussnoteID = 1;
>   22
>   23 if (preg_match("/\*/", $zutat))
>   24 $kbA = 1;
>   25 else
>   26 $kbA = 0;
>   27
>   28 preg_match("/\b.*\b/", $zutat, $matches);
>   29 print "\n-->>$zutat";
>   30 $zutat = $matches[0];
>   31
>   32 print "\nZutat $zutat FussnotenID $FussnoteID kbA $kbA";
>   33
>   34 }
>   35
>   36 }
>   37
>   38 ?>
>
>
>
> mfg - micha
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Pushing array onto array

2003-08-02 Thread Hank TT
James,

My question had more to do with why the authors would give this usage when
array_push is not documented to behave so (as you correctly described).
Were they describing an earlier version of array_push?  A simple buggy
example?  A typo perhaps?

Since the authors Hughes and Zmievski are big names in PHP, though mortals
like you and me, I'm inclined to think they were thinking about something.




- Original Message -
From: "Jason Wong" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Sunday, August 03, 2003 1:27 AM
Subject: Re: [PHP] Pushing array onto array


> On Sunday 03 August 2003 13:02, Hank TT wrote:
> > Well, I might have been more specific about their example, since not
> > everyone has the book.  An excerpt below (so I don't need to retype all
the
> > names of characters and foul creatures from the Lord of the Rings):
> >
> > ---
> > $arr1 = array('G', 'R', 'Sr');
> > $arr2 = array('N', 'Su', 'O');
> >
> > $arr3 = array_push($arr1, $arr2);
> >
> > print $arr3[3][1];
> > //prints Su
> > ---
>
> I don't see how your example could work. array_push() does NOT return an
> array. The results of array_push() is placed in the first argument -- in
this
> case $arr1.
>
> > Weird usage
>
> Think of it like this -- it adds the 2nd array onto the 1st array.
>
> It does NOT add the *contents* of the 2nd array to the 1st array -- for
that
> you would probably use array_merge().
>
> Do a print_r($arr1), it might help you visualise what happens.
>
> --
> Jason Wong -> Gremlins Associates -> www.gremlins.biz
> Open Source Software Systems Integrators
> * Web Design & Hosting * Internet & Intranet Applications Development *
> --
> Search the list archives before you post
> http://marc.theaimsgroup.com/?l=php-general
> --
> /*
> It is now pitch dark.  If you proceed, you will likely fall into a pit.
> */
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>






-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Re: preg_match

2003-08-02 Thread Michael Temeschinko
Lee Doolan wrote:
"Michael" == Michael Temeschinko <[EMAIL PROTECTED]> writes:


Michael> Hello,
Michael> I would like to split a String containing ingredience with additional
Michael> assigned footnotes...
Michael> my problem I only get the first ingredience ($zutat at line 32 has
Michael> only one times the awaited value) but the print on line 29 shows me
Michael> that the value of $zutat is right at this point.
Michael> what's wrong 

Michael>1 2
Michael>3 $products_ingredience = 'Gersten-Grütze²*, Gerstenmehl²*,
Michael> Haferflocken*, Gemüse 12 % (Lauch*, Möhren*, Zwiebeln*), Haferkleie*,
Michael> Steinsalz, Petersilie*, Kartoffelstärke*, Hefeextrakt, Sellerieblatt*,
Michael> Kurkuma*, Muskatnuß*, Pfeffer*, Liebstöckl*';
Michael>4
Michael>5 ArtikelZutaten ($products_ingredience);
Michael>6
Michael>7
Michael>8 function ArtikelZutaten($products_ingredience) {
Michael>9
Michael>   10
Michael>   11 print "\n\n\n$products_ingredience)";
Michael>   12 $Zutaten = explode(",", $products_ingredience);
Michael>   13
Michael>   14 foreach ($Zutaten as $zutat) {
Michael>   15 if (preg_match("/\²/", $zutat))
Michael>   16 $FussnoteID = 2;
Michael>   17 else
Michael>   18 $FussnoteID = '';
Michael>   19
Michael>   20 if (preg_match("/¹/", $zutat))
Michael>   21 $FussnoteID = 1;
Michael>   22
Michael>   23 if (preg_match("/\*/", $zutat))
Michael>   24 $kbA = 1;
Michael>   25 else
Michael>   26 $kbA = 0;
Michael>   27
Michael>   28 preg_match("/\b.*\b/", $zutat, $matches);
Michael>   29 print "\n-->>$zutat";
Michael>   30 $zutat = $matches[0];
Michael>   31
Michael>   32 print "\nZutat $zutat FussnotenID $FussnoteID kbA $kbA";
Michael>   33
Michael>   34 }
Michael>   35
Michael>   36 }
Michael>   37
Michael>   38 ?>
what do you get if you 
  print "\nmatches matches..."; var_dump($matches);

right after line 32?

Hi Lee,

additionaly I have switched the warnings on:

Gersten-Grütze²*, Gerstenmehl²*, Haferflocken*, Gemüse 12 % (Lauch*, 
Möhren*, Zwiebeln*), Haferkleie*, Steinsalz, Petersilie*, 
Kartoffelstärke*, Hefeextrakt, Sellerieblatt*, Kurkuma*, Muskatnuß*, 
Pfeffer*, Liebstöckl*)
-->>Gersten-Grütze²*
Zutat Gersten-Grütze FussnotenID 2 kbA 1
matches matches...array(1) {
  [0]=>
  string(14) "Gersten-Grütze"
}

-->> Gerstenmehl²*
Notice: Undefined offset:  0 in /home/mt/amorebio/dem1.php on line 30
Zutat  FussnotenID 2 kbA 1
matches matches...array(0) {
}
-->> Haferflocken*
Notice: Undefined offset:  0 in /home/mt/amorebio/dem1.php on line 30
Zutat  FussnotenID  kbA 1
matches matches...array(0) {
}


 and so on

why does he matches only the first time ??

Greetings from Germany
Micha
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] preg_match

2003-08-02 Thread Michael Temeschinko
Hank Tt wrote:
Either of these should work:

preg_match("/\b.*\b/", trim($zutat), $matches);
Thank you - that's the solution :-)

mfg - micha

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php