php5

Generate email to file without sending

I want to generate an email using the mail() function: <?php $to = '[email protected]'; $subject = 'the subject'; $message = 'hello'; $headers = 'From: [email protected]' . "\r\n" . 'Reply-To: [email protected]' . "\r\n" . 'X-Mailer: PHP/' . phpversion(); // instead of sending mail, out put to file mail($to, $subj...

PHP class or function to return the URL of the FLV video from a page on YouTube

I want simple PHP class or function to return the URL of the FLV video from a page on YouTube to use this URL in another FLV player to play the video in my own player not with default YouTube player. ...

php mailing : check whether serer needs authentication or not ?

Hello guys, As we know it is possible to send emails using php mail() function. but in some servers it requires SMTP authentication (ie we have to provide an email address and password). How can I determine through a PHP script that the server require authentication or not. Thanks ...

IDE for PHP with Visual Designer?

Im new to PHP..I commonly see online that many PHP developers like to code php in simple notepad.. however its always nice to use an IDE which helps the user being more productive by making fewer mistakes and writing good code. My Question is "WHICH IS THE BEST IDE FOR DEVELOPMENT IN PHP?" Im looking for a PHP IDE which provides good:...

PHP - Recommended max array size - alternatives?

I'm writing a google maps page with about 160 records, 1 for each location. The original map data is held in a sql table. As there is quite a lot of text this could be a max of 900 characters per record. I filter this data my month so there may be 20-30 records shown as markers on the map. I want the user to quickly switch between mon...

PHP5 and mysql examples

is there any website which has given very good examples of php5 and mysql. how to use OOP for website development from small website to large. or is it good to start development in zend framework. ...

Question about selecting a child in xPath

Looking at w3schools for xPath (feel free to give me other references), you can select all the children of bookstore, but what if I wanted to only select the second book element? How can I do that? <?xml version="1.0" encoding="ISO-8859-1"?> <bookstore> <book> <title lang="eng">Harry Potter</title> <price>29.99</price> </book> <b...

Why can't I get rid of this Â&nbsp;?

Each line is a string Â&nbsp;4 Â&nbsp;minutes Â&nbsp;12 Â&nbsp;minutes Â&nbsp;16 Â&nbsp;minutes I was able to remove the  successfully using str_replace but not the HTML entity. I found this question: http://stackoverflow.com/questions/657643/how-to-remove-html-special-chars-in-php But the preg_replace did not do the job. How can ...

Best way to read zip file in PHP

file_get_contents("zip:///a/b/c.zip") is returning NULL. How can I read unzipped contents of a zip file in PHP 5+ ? ...

Generate fast pseudorandom data in PHP

I need to generate uncompressible data (therefore pseudorandom), and have been trying with the code below. But it's only producing about 10MB/s of data. I need about 100-200 MB/s. Do you have any advice? if ($length > 8*1024*1024){ //Default max string length in php. while (($length - $bytesGenerated)>8*1024*1024){ $bytesGen...

local file system access via HTML5 and PHP5

I want to enhance my browser-based web application with functionality that needs to read the absolute path of the files being uploaded and used for some processing, I have used HTML5 File API and PHP POST Upload method to support the upload functionality. Question: Direct or work around method of reading the absolute path (client-side) ...

Directory style redirects in PHP

Hi, it's been a very very long while since i did anything in PHP. Would anyone care to explain how to achieve such effect: i go to mydomain.com/user/peter and get a customized user page for this username 'peter' can it work such that peter gets piped to some php script that generates page for user parameter? it kind of works like passi...

How to ask input file browser from user in Drupal 7

Hi i need some help with it. I have created a php script which i am running from copy paste into node as php code. I need a file path for a file to process like i am using '\birds\birds.xml'. I dont want to include the file path instead i am thinking, How to create a simple small form with browse button and selecting a file than submit w...

php closure (Anonymous function)

A php closure or anonymous function is used to create function without specifying its name. Is it possible to call them without assigning to identifier as we do in JavaScript ? e.g. (function(){ echo('anonymous function'); })(); What is the correct use of use construct while defining anonymous function and what is the status of a...

zend framework select join error getTable()

I am trying to implement this method in my model: class Application_Model_MenuProfilesProducts extends Zend_Db_Table_Abstract { protected $_name = 'menu_profiles_products'; public function fetchProducts($profileID) { $select = Zend_Db_Table::getDefaultAdapter()->select() ->from(array('mpp' => 'men...

_COOKIE Info on the server Side

Hi all, I want to get the cookie information stored using setcookie function in the source code of the php.. not the php source code.. What is the corresponding C code for _COOKIE['xx']; In other words where is the _COOKIE array created and populated? ...

XAMPP (LAMPP) server not serving php files properly, browser tries to download the script & weird behavior

Hello everyone, I'm starting a new project using Linux and PHP, but for the early dev state i'm now, I'm trying to use XAMPP for now. I'm Running Ubuntu 10.04 x64 on a laptop, And got everything I need. The site I should build is based upon CodeIgniter and some implementation of smarty, but I think this is not that important because the...

Getting Mobile Number through Https request in GPRS

Hi all, Generally when we are using GPRS connection , the request will be sent to appropriate host as a http(s) request . In receiving side ( PHP ) , we are able to get the IP address using $_SERVER or $_REQUEST variable . Like that is there any way to get the mobile number that means from which mobile number request being given. Ca...

What is autoload in php?

what is autoload in PHP? ...

zip_read() expects parameter 1 to be resource, integer given

hi i am working with php5 in this i upload a zip file and also extract the zip file in folder where i uploaded it. but problem is created when i want to read that file using zip_read function but its give following error. Warning: zip_read() expects parameter 1 to be resource, integer given in C:\wamp\www\praveen\zipupload.php on li...