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

323 questions
51
votes
3 answers

Generate preview image from Video file?

Is there a way in PHP given a video file (.mov, .mp4) to generate a thumbnail image preview?
JD Isaacks
  • 56,088
  • 93
  • 276
  • 422
21
votes
2 answers

Is there a call_user_func() equivalent to create a new class instance?

How can I create a class with a given array of arguments to be sent to the constructor? Something along the lines of: class a { var $args = false; function a() {$this->args = func_get_args();} } $a = call_user_func_array('new…
Steve H
  • 946
  • 9
  • 22
18
votes
8 answers

Get date of Monday in current week in PHP 4

I need to find the date of Monday in the current week. How can I do this in PHP 4?
Ben Jones
  • 189
  • 1
  • 1
  • 3
14
votes
6 answers

Your experience Moving PHP 4 to PHP 5

We have to move around 50+ Applications (small / large) to PHP 5.3 (from PHP 4.1). Does some has any experience with such an task? Time needed Tools Best setup for environment (Servers/Test?) Does it make sense to move first to PHP 5.2? Is there…
opHASnoNAME
  • 20,224
  • 26
  • 98
  • 143
14
votes
6 answers

PHP: Define function with variable parameter count?

Is there a way to define a function in PHP that lets you define a variable amount of parameters? in the language I am more familiar with it is like so: function myFunction(...rest){ /* rest == array of params */ return rest.length;…
JD Isaacks
  • 56,088
  • 93
  • 276
  • 422
8
votes
3 answers

When and how to use Constants in PHP?

I'm currently programming a website (in PHP4). I plan to save values, which do not change during runtime, in constants. Those are for example the version number of login-data for the database. Question 1: are there any (security relevant) problems…
R_User
  • 10,682
  • 25
  • 79
  • 120
8
votes
2 answers

How do I determine if an array is empty in PHP?

I want to check that an array has no values or that the values in the array are empty. Can someone explain how to do this?
n92
  • 7,424
  • 27
  • 93
  • 129
8
votes
1 answer

Difference between old-style and new-style PHP constructors

Could someone tell me how the "old-style" object constructor is different from the "new-style" constructor? I'm learning PHP OOP, and I want to know when I'm reading old syntax vs new syntax, and better understand how OOP has changed in PHP over…
White Lotus
  • 353
  • 2
  • 6
  • 16
8
votes
1 answer

PHP 4 won't take PHP.ini changes after Apache restart

We have a very old PHP application that needs PHP 4 to run. We're decommissioning the old server and so I've built PHP 4 on the new server (Ubuntu 13.04 32 bit). When I did ./configure I made sure to do --with-config-file-path=/etc/php4/php.ini. …
nwalke
  • 3,170
  • 6
  • 35
  • 60
7
votes
4 answers

How to use nuSOAP for messages with multiple namespaces

I'm trying to access a WebService using nuSOAP (because I'm bound to PHP4 here) that uses more than 1 namespace in a message. Is that possible? An example request message would look like this:
wilth
  • 705
  • 2
  • 8
  • 19
7
votes
3 answers

php output with sleep()

I'm trying to run a loop every second for 25 seconds basically. for($i = 0; $i <= 25; $i += 1){ echo $i; sleep(1) } The thing is it doesn't output until it's fully done, so after the loop continues 25 times. Is there a way to do this so…
dzm
  • 22,844
  • 47
  • 146
  • 226
7
votes
4 answers

PHP4: Send XML over HTTPS/POST via cURL?

I wrote a class/function to send xml over https via PHP4/cURL, just wondering if this is the correct approach, or if there's a better one. Note that PHP5 is not an option at present. /** * Send XML via http(s) post * * curl --header…
starmonkey
  • 3,147
  • 2
  • 20
  • 15
7
votes
2 answers

Using mail() to send an attachment AND text/html in an email in PHP4

To make life difficult, the client I'm working for is using a really large yet old system which runs on PHP4.0 and they're not wanting any additional libraries added. I'm trying to send out an email through PHP with both an attachment and…
James Donnelly
  • 126,410
  • 34
  • 208
  • 218
6
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
  • 56,088
  • 93
  • 276
  • 422
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
1
2 3
21 22