I'm trying to strip comments out of my code. I can get it to strip one
section of comments but the problem comes in when I have more then one
comment section to strip.
I am using this: $code = preg_replace('/\/*(.*?)*\//is', '$1', $code) and
need help fixing my regex.
example:
code 1
On Sun, Oct 05, 2003 at 04:46:16AM -0400, zzz wrote:
:
: I'm trying to strip comments out of my code. I can get it to strip one
: section of comments but the problem comes in when I have more then one
: comment section to strip.
:
: I am using this: $code = preg_replace('/\/*(.*?)*\//is', '$1',
You will run into more problems and there are many things you need to
consider, for example "/*" in a string. But token_get_all() will parse
php code for you and will make things much simpler.
zzz wrote:
I'm trying to strip comments out of my code. I can get it to strip one
section of comments
Hey perfect Eugene, thanks
-Original Message-
From: Eugene Lee [mailto:[EMAIL PROTECTED]
Sent: October 5, 2003 5:14 AM
To: [EMAIL PROTECTED]
Subject: Re: [PHP] stripping comments
On Sun, Oct 05, 2003 at 04:46:16AM -0400, zzz wrote:
:
: I'm trying to strip comments out of my code. I can
will something in the likes of this be possible in php5?
/***/
class some_classname
{
function some_function();
}
function some_classname::some_function($prefix, $text) {
return $prefix.": ".$text."\n";
}
$test = new some_classname;
$test->some_function("Output","Hello World!");
if you want to use variable's in a function you need to give
the function the paramaters..if you do not with to use it like that..
declare the vars in the beginning of the class
class classname
{
var $1;
var $2;
}
greetz
--
--
It's Not God Th
Robert Cummings wrote:
On Sat, 2003-10-04 at 08:18, Terence wrote:
Bloody hell Rob, you've started me on another rant when I could be in bed ;)
*grin* glad to help out.
XSLT is a pain in the butt if you want to master it - particularly if
you're going from imperative programming to declarat
Rush wrote:
"Terence" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
<>
If you *do* finally decide to master XSLT, you have to conclude that
*any* other templating system is a complete/utter waste of time. (all
authors of ``yet another PHP templating system'', please try not to be
off
Im trying to create some dummy code where child classes can talk to each
other.
Im looking to verify some behaviour Im running into.
When a child extends a parent, from that point on, the parent, has no idea,
on what the child is capable of, or what it contains.
Is that a "real" parent??? ;)
With
* Thus wrote Gerard Samuel ([EMAIL PROTECTED]):
> Im trying to create some dummy code where child classes can talk to each
> other.
> Im looking to verify some behaviour Im running into.
> When a child extends a parent, from that point on, the parent, has no idea,
> on what the child is capable of
> Im looking to verify some behaviour Im running into.
> When a child extends a parent, from that point on, the parent, has no idea,
> on what the child is capable of, or what it contains.
> Is that a "real" parent??? ;)
No but if you really wanted to you could create a framework for paren
php-general Digest 5 Oct 2003 16:35:09 - Issue 2337
Topics (messages 165079 through 165091):
Re: Attempt at putting greedy htmlspecialchars on a diet
165079 by: Gerard Samuel
stripping comments
165080 by: zzz
165081 by: Eugene Lee
165082 by: Marek Kilimajer
Hi I need to upload two resized images out from one jpg image. I use
following code to do it:
This code is working perfectly but produces only one uploaded and
resized image (I comented out the lines that I add for second image)
If I take out comments from the code on the second image - this
Dan Anderson wrote:
Im looking to verify some behaviour Im running into.
When a child extends a parent, from that point on, the parent, has no idea,
on what the child is capable of, or what it contains.
Is that a "real" parent??? ;)
No but if you really wanted to you could create a framew
Out of curiousity, what exactly are you trying to do? Are you sure this
type of framework is most appropriate (and easiest to implement?)
-Dan
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Dan Anderson wrote:
Out of curiousity, what exactly are you trying to do? Are you sure this
type of framework is most appropriate (and easiest to implement?)
In my current setup, the more classes Im adding to the code, the more
complex things seem to get.
For example.
I have a smarty object that
Hi list,
I have just installed PHP4.3.3-Win32. I have a book that said create a
phpinfo.php ( ) file and place it in my Apache 2 htdocs
file. I did this and when I run it opens in a blank page of DreamweaverMX.
I tried to "open with" Internet Explorer and it does nothing.
My question is what fi
Try http://localhost/phpinfo.php
apache serves http requests, you tried opening the file from filesystem.
John Hicks wrote:
Hi list,
I have just installed PHP4.3.3-Win32. I have a book that said create a
phpinfo.php ( ) file and place it in my Apache 2 htdocs
file. I did this and when I run it
Did you try to browse to it on your machine such as:
http://localhost/phpinfo.php
This is what they're referring to. PHP doesn't interpret pages when you just
double-click on them since they're not being run through the web server
(Apache) which will trigger PHP to parse the file.
-M
-Origi
The file should be saved in the webserver root.you didn't
mention whether or not you still have IIS installed, but if you do, you need
to uninstall it. You cant run both apache and IIS on the same port.
Regard Dreamweaver.you can open in DW and use the Open With
option for
--- John Hicks <[EMAIL PROTECTED]> wrote:
> I have just installed PHP4.3.3-Win32. I have a book that said create
> a phpinfo.php ( ) file and place it in my Apache 2
> htdocs file.
So you installed both Apache and PHP?
The first thing you need to do is figure out what your document root is (it i
On Sun, 2003-10-05 at 09:52, Terence wrote:
>
> PS.
> Stop teasing us and give us the link to your open-source solution. I may
> be able to poach some ideas for my open-source solution :)
>
Look no further than the signature. I thought it was bulky enough, but I
guess I'll need to make it bigge
I've been trying to make a simple script which just
outputs the username that the script is currently
executing under (in order to test that suexec is
working properly). I've tried using the following
line:
and it fails to produce any output and returns the
following error in my log file: "[Sun
PHP is most commonly run as an Apache API, though it can still be done as CGI.
Edward Dudlik
Becoming Digital
www.becomingdigital.com
- Original Message -
From: "[ASDF] Jeremy" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Saturday, 04 October, 2003 04:59
Subject: [PHP] Apache AP
What I would do is pass the handles to the objects in the class
constructor by reference. For example create one db object similar to
this:
class database
{
...
}
$db = new database();
and then pass the reference to all other classes like this:
class smarty
{
var $db;
function smarty(
Hi,
is there a function in PHP that will work out the amount of time(hours)
beween two different dates / times?
Thanks for your help
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
How cant i unsuscribe from this list? Thanks
Como puedo darme de baja? Gracias
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
On Sunday 05 October 2003 16:40, Sonia wrote:
> How cant i unsuscribe from this list? Thanks
>
> Como puedo darme de baja? Gracias
Read the bottom of every email you get from this list.
--->PHP General Mailing List (http://www.php.net/)
--->To unsubscribe, visit: http://www.php.net/unsub.php
He
--- Shaun <[EMAIL PROTECTED]> wrote:
> is there a function in PHP that will work out the amount of time(hours)
> beween two different dates / times?
You can just subtract the timestamps the find the number of seconds between any
two times. PHP has a rich set of functions to help you generate times
Jeremy Johnstone wrote:
What I would do is pass the handles to the objects in the class
constructor by reference. For example create one db object similar to
this:
class database
{
...
}
$db = new database();
and then pass the reference to all other classes like this:
class smarty
{
var $db;
Is there a way to attach a file with the mail() function?
Thanks!
On Monday 06 October 2003 07:34, Roy W wrote:
> Is there a way to attach a file with the mail() function?
Yes.
--
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
---
I would have to see your code, but maybe you don't need to be passing
the references your doing. Why does your Smarty class need to access the
database? Why does your Smarty class need a reference to the user
management class inside it? Personally, I see your user class being the
only one which nee
Jeremy Johnstone wrote:
I would have to see your code
That can be arranged.
Ill email you offlist.
, but maybe you don't need to be passing
the references your doing. Why does your Smarty class need to access the
database? Why does your Smarty class need a reference to the user
management class i
On Monday 06 October 2003 00:32, Yury B. wrote:
> Hi I need to upload two resized images out from one jpg image. I use
> following code to do it:
[snip]
> This code is working perfectly but produces only one uploaded and
> resized image (I comented out the lines that I add for second image)
> If
I'm having trouble getting PHP's built-in session management to rewrite my
tags to include the session ID across pages when cookies are
disabled. Unfortunately, PHP seems to only add the PHPSESSID to a link if
the page ends in ".php", not ".html".
I've preferred to hide my ".php" extensions and s
Jason Wong wrote:
> On Monday 06 October 2003 07:34, Roy W wrote:
>
>>Is there a way to attach a file with the mail() function?
>
>
> Yes.
>
Is there a way to have PHP print out "Hello World"?
--
By-Tor.com
It's all about the Rush
http://www.by-tor.com
--
PHP General Mailing List (http://w
> Jason Wong wrote:
>> On Monday 06 October 2003 07:34, Roy W wrote:
>>
>>>Is there a way to attach a file with the mail() function?
>>
>>
>> Yes.
>>
>
> Is there a way to have PHP print out "Hello World"?
>
Mr Wong has had his panties in a bunch all day, you may not want to bait him.
Mike
--
P
I'm running PHP 4.3.2 on Mac OS X 10.2.8, with .html files parsed by
PHP (specified with a local .htaccess file), and everything seems to be
working fine here (.html URLs are re-written by PHP).
My advice would be to delete all your cookies, clear your cache,
restart your browser with cookies d
On Monday 06 October 2003 08:28, [EMAIL PROTECTED] wrote:
> > Jason Wong wrote:
> >> On Monday 06 October 2003 07:34, Roy W wrote:
> >>>Is there a way to attach a file with the mail() function?
> >>
> >> Yes.
> >
> > Is there a way to have PHP print out "Hello World"?
>
> Mr Wong has had his pantie
Hi,
Monday, October 6, 2003, 3:20:08 AM, you wrote:
GS> Dan Anderson wrote:
>>Out of curiousity, what exactly are you trying to do? Are you sure this
>>type of framework is most appropriate (and easiest to implement?)
>>
GS> In my current setup, the more classes Im adding to the code, the more
Hi,
Monday, October 6, 2003, 4:43:20 AM, you wrote:
JW> I've been trying to make a simple script which just
JW> outputs the username that the script is currently
JW> executing under (in order to test that suexec is
JW> working properly). I've tried using the following
JW> line:
JW>
JW> and it
[EMAIL PROTECTED] wrote:
Jason Wong wrote:
On Monday 06 October 2003 07:34, Roy W wrote:
Is there a way to attach a file with the mail() function?
Yes.
Is there a way to have PHP print out "Hello World"?
Mr Wong has had his panties in a bunch all day, you may not want to bait him.
Mike
* Thus wrote Justin French ([EMAIL PROTECTED]):
> I'm running PHP 4.3.2 on Mac OS X 10.2.8, with .html files parsed by
> PHP (specified with a local .htaccess file), and everything seems to be
> working fine here (.html URLs are re-written by PHP).
>
> My advice would be to delete all your cooki
Tom Rogers wrote:
To do this I have my classes register themselves in a global array.
For example a mysql class which gets used a lot does this in its constructor:
function mysql_class($db='',$ini=''){
global $class_ref;
$class_ref["mysql_class"] =& $this;
.
.
.
}
Then any class that needs ac
> Actually, I think Jason is as just tired of seeing the same, already
> answered, questions over and over again...like alot of us are. I think
> he's tired of people who won't take one bit of their time to look up
> answers for themselves, but expect us to hold their hand and waste our
> time...
Hi,
Well I must have missed that one :)
My answer, if GLOBALS were not meant to be used they wouldn't be there..
So if they make life easier go ahead and use them. I notice a lot of 'purists'
on this list that want things done a certain way but the bottom line is do what
your comfortable with and
> Then he doesn't have to respond. If he's not interested in a thread, he
> should delete it. Tossing a useless one word answer onto the list isn't
> helping to reduce the volume of email in everyones inbox. So far today
> I've had probably close to 15 OT emails from several threads land on my
> m
[EMAIL PROTECTED] wrote:
I've had probably close to 15 OT emails from several threads land on my
machine, none of them useful (including this one) none of them relating to
PHP (including this one) and all of them avoidable (including this one) if
he had just hit delete rather than send.
You could
* Thus wrote John Wilcox ([EMAIL PROTECTED]):
> I've been trying to make a simple script which just
> outputs the username that the script is currently
> executing under (in order to test that suexec is
> working properly). I've tried using the following
> line:
>
>
This var isn't the USER that
On Sun, Oct 05, 2003 at 09:58:55PM -0500, John Nichel wrote:
: [EMAIL PROTECTED] wrote:
: >>Jason Wong wrote:
: >>>On Monday 06 October 2003 07:34, Roy W wrote:
: >>>
: Is there a way to attach a file with the mail() function?
: >>>
: >>>Yes.
: >>
: >>Is there a way to have PHP print out "Hello
On Sun, 2003-10-05 at 23:37, Tom Rogers wrote:
> Hi,
>
> Well I must have missed that one :)
> My answer, if GLOBALS were not meant to be used they wouldn't be there..
> So if they make life easier go ahead and use them. I notice a lot of 'purists'
> on this list that want things done a certain wa
* Thus wrote [EMAIL PROTECTED] ([EMAIL PROTECTED]):
>
> > Actually, I think Jason is as just tired of seeing the same, already
> > answered, questions over and over again...like alot of us are. I think
> > he's tired of people who won't take one bit of their time to look up
> > answers for themse
* Thus wrote Eugene Lee ([EMAIL PROTECTED]):
> On Sun, Oct 05, 2003 at 09:58:55PM -0500, John Nichel wrote:
> : [EMAIL PROTECTED] wrote:
> : >>Jason Wong wrote:
> : >>>On Monday 06 October 2003 07:34, Roy W wrote:
> : >>>
> : Is there a way to attach a file with the mail() function?
> : >>>
> :
* Thus wrote Tom Rogers ([EMAIL PROTECTED]):
> Hi,
>
> Monday, October 6, 2003, 3:20:08 AM, you wrote:
>
>
> To do this I have my classes register themselves in a global array.
> For example a mysql class which gets used a lot does this in its constructor:
>
> function mysql_class($db='',$ini='
On Mon, 6 Oct 2003 04:26:55 +
Curt Zirzow <[EMAIL PROTECTED]> wrote:
> That being said, I think i'll have this thread grow way off topic,
> and self promote my site.
>
> Now we can visually see how often somone helps people with the
> list:
> http://zirzow.dyndns.org/html/mlists/php_genera
On Mon, 2003-10-06 at 00:48, Curt Zirzow wrote:
>
> On the global topic, I would suggest establishing a standard
> naming convention for your common globals that are used, I do
> something like:
> $__object_something__;
>
> With your global var I can see myself writing something that will
> over
On Monday 06 October 2003 12:42, andu wrote:
> I was going to suggest, since you are into list statistics, to count how
> many of Mr Wang's replies consist of something more then a reference to the
> manual and similar (I counted over 50% in a day I had time to kill).
If you are referring to me,
Hi Tom, when I put "echo `printenv`;" into a script, I
see in big bold letters: USER=john so this environment
variable seems to be available.. getenv('USER');
works fine, so I guess I'll just use that instead.. No
idea why $_ENV['USER']; doesn't work though. Thanks
for the suggestion,
John
---
On Mon, 6 Oct 2003 13:07:36 +0800
Jason Wong <[EMAIL PROTECTED]> wrote:
> On Monday 06 October 2003 12:42, andu wrote:
>
> > I was going to suggest, since you are into list statistics, to count how
> > many of Mr Wang's replies consist of something more then a reference to the
> > manual and simi
On Sun, 5 Oct 2003 04:46:16 -0400, you wrote:
>I'm trying to strip comments out of my code. I can get it to strip one
>section of comments but the problem comes in when I have more then one
>comment section to strip.
>
>I am using this: $code = preg_replace('/\/*(.*?)*\//is', '$1', $code) and
>ne
Hi all,
Having a slight problem with mysql select query right here.
I've learnt that if I were to select a particular data within the last 30 days,
this is what my select query should be like:
SELECT something FROM tablename
WHERE TO_DAYS(NOW(()_TO_DAYS(date_column)<=30;
(This query sel
On Mon, 6 Oct 2003 14:22:59 +0800, you wrote:
>Now my question is: What if I would like to display data for the CURRENT MONTH
>and the last 11 months???(May also said to be the LAST MONTHS)
>HOw should my select query be like??
This question isn't on-topic for this list; it's about SQL, not PHP.
n Mon, 6 Oct 2003 14:22:59 +0800, you wrote:
>Now my question is: What if I would like to display data for the CURRENT MONTH
>and the last 11 months???(May also said to be the LAST MONTHS)
>HOw should my select query be like??
On Mon, 06 Oct 2003 07:30:26 +0100, David Otton
<[EMAIL PROTECTED]>
>Now my question is: What if I would like to display data for the CURRENT MONTH
>and the last 11 months???(May also said to be the LAST MONTHS)
>HOw should my select query be like??
On Mon, 06 Oct 2003 07:30:26 +0100, David Otton
<[EMAIL PROTECTED]> wrote:
This question isn't on-topic for this
Aye. PHP already reserves function names prepended with __ as magic. But
really one could make this argument ad infinitum. If everyone wants to start
their variables with a *insert random character here*, "*grin*"
IMHO it's good advice to "prepend global vars with '__' or something". I
usually
Hi to all,
I'm trying to have the output of the "ps -ef" command in Linux to my
browser. Can anyone help how to properly have the output in proper format.
I've used the passthru() function but the output is scrambled.
Thanks in advanced.
Mike
--
PHP General Mailing List (http://www.php.net/)
67 matches
Mail list logo