php5.3

Least sloppy way to enforce allowable values or ranges for class properties

Say hypothetically I have a class... class Main { $prop1 = 2; $prop2 = 23; ... $prop42 = "what"; function __construct($arg_array) { foreach ($arg_array as $key => $val) { $this->$key = $val; } } } Say I create and object... $attributes = array("prop1"=>1, "prop2"=>3...

Getting error reports about the php.ini file itself

Good day all. I am trying to cajole my new office into having Correct Procedures. I'm trying to prove that everyone can have a local checkout of the code and it will all be OK, but PHP is not playing along. I have set up my Apache vhost to load a specific php.ini for the site, and it looks like this: [php] include_path = ".:/home/alas...

Peculiar Behaviour with PHP (5.3), static inheritance and references.

I'm writing a library in PHP 5.3, the bulk of which is a class with several static properties that is extended from by subclasses to allow zero-conf for child classes. Anyway, here's a sample to illustrate the peculiarity I have found: <?php class A { protected static $a; public static function out() { var_dump(static::$a); } ...

Do PHP closures not have access to parnt function parameters?

Hi, I've been writing some code for PHP 5.3, and I wanted to do something similar to the code I'm showing below. I expect this code to print 'hellohello', but it prints 'hello' instead, and an error. It appears the $inner closure does not have access to the outer function's parameters. Is this normal behavior? Is it a PHP bug? I can't s...

php DomDocument xpath: how can i print the all html content of an element resulted from an xpath query?

Hiya. I'm using DomDocument to query for html elements. when i use $obj->textContent or $obj->nodeValue it returns only the texts that include in the element, it does not return the html representation of the object. which means.. if the object contains <div>test</div> the return value for both tries will be test. how do i fetch the...

How to create a generate code section in our site ?

I have to give the Html code of my order form to third parties. Once they register and payed they can copy and paste the html code from my site to their own site. but the date will be saved in my site with the reference of the reseller. How can I implement this kind of a section in my website. any body can help me. I am using php5 and my...

Has PHP 6 been changed to PHP 5.3?

I can't find any info on PHP 6, did they change their minds about the numbering and just fold it all in to PHP 5.3? What is the state of PHP 6? ...

Non-threadsafe source for PHP?

How I get the non-threadsafe source for PHP? The only download link I found on windows.php.net/download was http://windows.php.net/downloads/releases/php-5.3.2-src.zip and that appears to be the threadsafe code --- or is there some way of telling the source that it's actually non-threadsafe? I have tried putting --disable-zts on the com...

PHP 5.3.2, Where do I find php5apache2_2.dll?

I'm upgrading my local version of PHP to 5.3.2, on Windows. I'm running Apache 2.2 right now. I've downloaded the zipped VC6 version of PHP from here: http://windows.php.net/download/ To my dismay, there's no php5apache2_2.dll file anywhere in the ZIP, and unfortunately Google is no help. I don't understand how anybody manages to get...

Overriding fetch() for PDO when fetching using foreach

I have extended PDOStatement and modified the fetch() method to typecast values of the types timestamp and arrays, in PostgreSQL, to DateTime and native array. This works as intended but I can't override the behaviour when using the statement in a foreach. I have solved this by returning rows into an object implementing ArrayAccess, Ite...

How do I recursively delete a directory and its entire contents (files+sub dirs) in PHP?

How do I delete a directory and its entire contents (files+sub dirs) in PHP? ...

php replacement for safe_mode

i am new to learning PHP and so I've installed the latest version (5.3.3) and am writing some code. i have run across this error: PHP Warning: curl_setopt() [function.curl-setopt]: CURLOPT_FOLLOWLOCATION cannot be activated when safe_mode is enabled or an open_basedir is set in C:\Rush\dev\personal\Numina.Framework\Development\PHP L...

convert unix timestmp to date

how to I convert a unix timestamp 1280214000 to human readable date? thanks ...

Where to find demo code of working PHP extension for VS2008 targetting PHP 5.3.x and Windows?

There seem to be so many half-documented ways of writing extensions for PHP in Windows. Can anyone point me to source code which demonstrates an extension compiled under VS2008 and working in a PHP 5.3.x environment? ...

how to display all data from database to webpage in table format using php5?

hi guys i want to display all my data in table format i try following code but it gives error :" Fatal error: Maximum execution time of 30 seconds exceeded in C:\Temp\5Aug2010\test.php on line 35 " this is my code : <?php // Connects to your Database mysql_connect("localhost", "root", "") or die(mysql_error()); mysql_se...

How to read an HTML page line by line using php?

How to read an HTML page line by line using php. I have to add and edit some file paths of my html page using php. ...

how to maintain paragraph?

i have a problem when i insert some articles which includes paragraph to database at the time of retrieval it display article but without paragraph. so it look like dirty writing on the page. so is there any trick or code for save article with paragraph & at time of display it shows as it is. ...

Deprecated: Function split() is deprecated. How to rewrite this statement?

I have the following statement which worked fine before PHP 5.3: list($year, $month, $day, $hour, $min, $sec) = split( '[: -]', $post_timestamp ); After upgrading to PHP 5.3, I get the Deprecated warning of the title. I am trying to parse a string with format like: 2010-08-10 23:07:58 into its component parts. ...

Diferences between php5apache2_2_filter.dll and php5apache2_2.dll

Besides the name, what are the differences between loading one or another? I got issues with APC and X-Debug, I know that is a quick way to crash Apache but my application relies in APC and I MUST profile with WebGrind so it's no option for me to disable either. So I'm trying to think out of the box. What I can't do: Disable APC or X...

how to find out Third week days in between Two Dates using php

Hi guys, I need to display Third Week Third week days in between Two Dates using php For Ex: Start Date: 2010-08-02 End Date : 2010-08-30 i need to display 2010-08-13 to 2010-08-19 Please Help Me!...................... Thanks in advance ...