Questions tagged [php4]

For issues relating to development using PHP, version 4.

PHP is a widely-used, general-purpose scripting language designed specifically for web development, though it has since been extended to other applications too. PHP is the most popular language for web development, powering over 20 million websites.

Useful Third-party Code and Tools

In addition to the vast functionality provided in the PHP Core and through PEAR and PECL, there are a number of noteworthy 3rd party contributions to the PHP world, some of which are listed below.

Related tags

328 questions
5
votes
9 answers

How can I find out the date of the day before a date?

I have a system that compares fiscal year up to the current date to the same date range of the year before. You can adjust the year and month to look at and it always compares the same date range to the year previous. I have it set so if the current…
JD Isaacks
  • 51,154
  • 89
  • 267
  • 413
5
votes
1 answer

Why PHP 4.4.9 throws 'Parse error: syntax error, unexpected T_STATIC'?

I just realized the professor Google is unable to present a specific page where I can find out, when static keyword added to PHP 4. Though following the change log for php 4 I can see that it was available since Version 4.0.6 (or before) but why…
Ahmed Memon
  • 219
  • 3
  • 11
5
votes
2 answers

Using static properties in PHP >= 4.3.0?

Disclaimer: Yes, I am forced to support PHP 4.3.0. I know it's dead. No I can't upgrade it, because I'm dealing with multiple servers some of which I don't have su access. Well, since I can't use self:: since it's PHP5 specific, how should I go…
meder omuraliev
  • 171,706
  • 64
  • 370
  • 423
5
votes
5 answers

Official end of support for PHP4?

Is there an official date for when support for PHP4 will end? I keep reading this date and that on various sites and blogs, but can't find anything on the PHP website. Am I overlooking something?
Pekka
  • 418,526
  • 129
  • 929
  • 1,058
5
votes
3 answers

PHP: Turn HTML table into spread sheet?

I am generating an HTML table full of data. They need it to be an editable spreadsheet though that they can save and edit. I currently have it exactly as they want but as an HTML table, is there anyway I can convert this to an excel spread sheet…
JD Isaacks
  • 51,154
  • 89
  • 267
  • 413
4
votes
3 answers

How can I figure out the number of week days in a month?

I'm having this problem right now: given a month and a year, I'd need to know how many week days it has (that is, the number of days excluding Saturday and Sunday). It seems so simple, and yet I'm baffled. Of course I could solve it with a for loop…
zneak
  • 124,558
  • 39
  • 238
  • 307
4
votes
3 answers

Client does not support authentication protocol requested by server

I need to establish PHP4 environment in conjunction with mysql5 and I am facing this problem when I try to connect to mysql. Thank you for any trace.
palmic
  • 1,786
  • 2
  • 19
  • 30
4
votes
6 answers

PHP: Get class name of passed var?

I have a function that gets a class passed to it as a parameter. I would like to get the class name of the passed class as a string. I tried putting this method in the passed class: function getClassName() { return __CLASS__; } but…
JD Isaacks
  • 51,154
  • 89
  • 267
  • 413
4
votes
1 answer

Why is PHP CodeSniffer Freezing?

I'm a Junior Programmer where I work. Our website was written using PHP 4. We're migrating from PHP 4 to PHP 5.3. There are roughly 5000 PHP files in around 595 directories. So, as you can imagine, the scope of this project is pretty huge. We use…
dqfan2012
  • 117
  • 10
4
votes
6 answers

Cannot re-assign $this?

I have a script on a server that had php version 4. Now it is changed to php5 and the script does not function any more. I get this error: Fatal error: Cannot re-assign $this in URL database.php line 88 In the file is a class that has a function.…
Atha
  • 55
  • 1
  • 5
4
votes
2 answers

Do PHP variable functions work in PHP4?

I know you can do something like this in PHP5: function sayHi() { echo "Hi!"; } $func = "sayHi"; $func(); It is called a variable function in the documentation. But the docs don't say anything about what versions of PHP this works on. This…
chowey
  • 7,470
  • 4
  • 46
  • 72
3
votes
2 answers

PHP require statement - Fails, but throws E_WARNING instead of E_COMPILE_ERROR

I moved a file in our system to a sub folder for organization, which in turn broke a require statement's relative path. This should have resulted in a E_COMPILE_ERROR warning. However, instead of that error, our custom error handler in the…
teynon
  • 6,248
  • 9
  • 56
  • 93
3
votes
3 answers

Split a string, excluding some characters

Possible Duplicate: Split string by delimiter, but not if it is escaped I have a string generated form ibm informix database which is separated by pipe | characters and there are some data errors, which means there are backslash + pipe inside the…
lankitha
  • 263
  • 7
  • 15
3
votes
3 answers

PHP 4.4.1 JSON ENCODE

I have a jQuery login form that uses $post function to send credentials to the php script that checks the credentials againts the users in the database. I have been using PHP 5.2 and have been using echo json_encode($data); in my php scripts to send…
Chill Web Designs
  • 1,271
  • 2
  • 14
  • 30
3
votes
1 answer

Best way to implement try catch in php4

What is the closest you can get to a try-catch block in php4? I'm in the middle of a callback during an xmlrpc request and it's required to return a specifically structured array no matter what. I have to error check all accesses to external…
rgz
  • 276
  • 4
  • 18
1
2
3
21 22