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
1
vote
1 answer

PHP Json output formatting

I am parsing Json using PHP. Here is a small part of my code $rootObj = array( 'MainEvent' => $event_value['MainEvent'], 'OutcomeDateTime' => $formatteddate->format('Y-m-d H:i:s'), 'OutcomeDateTimeUTC' =>…
user3754380
  • 651
  • 2
  • 7
  • 15
1
vote
1 answer

Cannot convert new database connection to older one

I need to convert this new database connectivity and retrive information from database to older fashion for my project. I have done the connection according to older fashion way PHP 4.0 but i need to use this PDO connectivity code to older database…
user3659737
  • 31
  • 1
  • 8
1
vote
1 answer

Simulating old LAMP stack on local machine

I am currently working on legacy code, and I'm trying to find a way to recreate the server environment for this old site. The site is written in PHP4, so I am having trouble working with it on my local machine, because I have PHP 5.5 installed for…
xJoshWalker
  • 457
  • 2
  • 12
1
vote
1 answer

PHP Bambalam and External Libraries

I am trying to "compile" a php file with bambalam that uses the BCMATH library, which is built into PHP as of a while ago. When I "compile" the file, the function "bcpowmod" errors on runtime. I manually downloaded the php_bcmath.dll and included it…
Mike
  • 23
  • 3
1
vote
2 answers

Process an array in a function, with external formatting

I want to pass an array to a function and iterate through it in this function. But I would like to be able to change the way the single entries are displayed. Suppose I have an array of complicated objects: $items = array($one, $two, $three); Right…
blinry
  • 4,746
  • 4
  • 26
  • 31
1
vote
4 answers

Why is the PHP assignment operator acting as an assignment by reference in this case?

I have some code that appears to behave differently between PHP 4 and PHP 5. This code below: class CFoo { var $arr; function CFoo() { $this->arr = array(); } function AddToArray($i) { $this->arr[] = $i; …
Doug T.
  • 64,223
  • 27
  • 138
  • 202
1
vote
1 answer

Getting WampServer to run PHP4 (on Windows 7)

I tried to get PHP4 working on WampServer, but whenever I started WampServer, the icon would go to orange but not all the way to green, because Apache wasn't starting. I've explained how I got it working below. Hopefully this helps someone.
Alan L
  • 1,785
  • 19
  • 28
1
vote
1 answer

finding image of the remopte url using preg_split

i want the content inside of the "img" tag from the string. for ex:- if str="< img src="/files/thumbnails/001.simonhiggins_comm games_thumb.jpg" title="Commonwealth Games" alt="showreel" class="clear-right-margin" />" then i want to o/p using…
Salil
  • 46,566
  • 21
  • 122
  • 156
1
vote
3 answers

What's wrong with this PHP4 class to do AES encryption?

When I decrypt something encrypted with this function, the decrypted version doesn't equal the original. class AES256encryption { var $secret = ''; var $cipher_key = ''; function AES256encryption($secret='') { if…
Truman Leung
  • 143
  • 1
  • 6
1
vote
1 answer

how i can this log in system with yahoo,twitter,facebook etc

in many sites i can see alt text http://img718.imageshack.us/img718/4633/15494794.gif how i can do that is must tell every company or what?
Mostafa Elkady
  • 5,645
  • 10
  • 45
  • 69
1
vote
1 answer

Problem with searchd protocol error in sphinx

I am getting the error ERROR: expected searchd protocol version 1+, got version '0'. Does anyone knows why is it coming so when i run test2.php of sphinx api(ver 0.9.9-win32).
akku
  • 71
  • 5
1
vote
1 answer

PHP SQL Return just returns "Array"

I've tried using something similar to the following PHP code to retrieve items from a Firebird database. $sql = "select P_1,P_2,P_3 from p_players('$playerid', '')"; //This sends the SQL select statement to the db $rs=$db->Execute($sql); //This…
1
vote
1 answer

PHP: Warning: array_merge_recursive(): recursion detected

I have a list of arrays (unknown amount), I need to merge all of them recursively. So what I did what create an array of all of those arrays and pass them into this function: function mergeMonth($array) { foreach($array as $date_string =>…
JD Isaacks
  • 56,088
  • 93
  • 276
  • 422
1
vote
1 answer

Is mb_strlen a suitable replacement for iconv_strlen

That is, if I'm coding something entirely in PHP4? Or perhaps I should use a custom function or class/extension instead to count the number of characters in a multibyte string? Only difference I can spot is that mb_string strips out bad sequences,…
meder omuraliev
  • 183,342
  • 71
  • 393
  • 434
1
vote
0 answers

openssl_sign and PHP 4 identical signature for different messages

I have to maintain an application in php 4 that must send signed data via openssl_sign. The issue is that for different data of the same size, the signature is always the same. Eg. this code: $signature = null; $message1 = 'foobar'; $privkey1 =…