Today's Question:  What does your personal desk look like?        GIVE A SHOUT

 PHP


  Execute PHP from a .html File

How can I execute PHP code on my existing myfile.html page?:When a web page is accessed, the server checks the extension to know how to handle the page. Generally speaking if it sees a .htm or .html file, it sends it right to the browser because it doesn't have anything to process on the server. If it sees a .php extension (or .shtml, or .asp, etc), it knows that it needs to execute the appropriate code before passing it along to the browser. Here is the problem: You find the perfect script, and you want to run it on your site, but you need to included PHP on your page for it to work. You ...

6,863 0       PHP HTML PHP IN HTML ADDTYPE


  Easy Parallel Processing in PHP

The proliferation of multicore CPUs and the inability of our learned CPU vendors to squeeze many more GHz into their designs means that often the only way to get additional performance is by writing clever parallel software. One problem we were having is that some of our batch processing jobs were taking too long to run. In order to speed the processing, we tried to split the processing file into half, and let a separate PHP process run each job. Given that we were using a dual core server, each process would be able to run close to full speed (subject to I/O constraints).Here is our technique...

6,743 0       PHP PARALLEL PROCESSING MULTITHREADING LIKE SLEEP


  Top 10 Best Free PHP Frameworks of 2015

Like it or not, PHP is still, the most celebrated as well as an influential platform which is widely admired for its brilliant HTML, database integration support, intuitive features, and simple in learning too. Using diverse PHP frameworks, developers can create robust, effective, well- defined and stable web application with an ease and therefore, saving towards development cost is possible. In essence, these frameworks facilitate scalability and enduring maintenance by obeying development standards, staying your code organized and permitting your application to progress and grow after s...

6,712 0       PHP FRAMWORKS CAKEPHP LARAVEL CODEIGNITER ZEND PHALCONPHP YII FUELPHP SYMFONY PHPIXIE SLIM


  10 less known but useful PHP functions

PHP has abundant built in functions. As PHP developers, we may have used many of them. But there are still some useful functions we may not be so familiar with. In this post, we will introduce some of them.levenshtein()Have you ever wondered how to check differences between two works? This function just does what you want. It can tell you how much the difference is between two words.<?php$str1 = "carrot";$str2 = "carrrott";echo levenshtein($str1, $str2); //Outputs 2?>get_defined_vars()This is a very useful function when you wants to debug your codes when there are some issues. It will re...

6,588 0       PHP FUNCTION


  Output control functions in PHP

The Output Control functions in PHP allow you to control when output is sent from the script. This can be useful in several different situations, especially if you need to send headers to the browser after your script has began outputting data. The Output Control functions do not affect headers sent using header() or setcookie(), only functions such as echo and data between blocks of PHP code. These output control functions include ob_start(0, ob_clean(),ob_get_contents(), etc. To be honest, I am always mess up these ob_xxx() functions, some of them have similar functions and some of them can ...

6,457 0       PHP RELATIONSHIP OUTPUT BUFFER OB


  socket_create() from command prompt with WAMP

Problem:I’m working on a wamp system, and have started playing around with sockets. I enabled sockets via the wamp interface:wamp : PHP settings : PHP extensions : php_socketsand could run my php file via my browser.When trying to run the same file via the command prompt (start : run : cmd), I got the following error:Fatal error: Call to undefined function socket_create() in … on line …Solution:The command prompt uses a different php.ini file to the apache server.The Apache php.ini file is accessible via the taskbar icon, and is located at:X:\WAMP INSTALL DIR\Apach...

6,438 0       PHP WAMP WINDOWS COMMAND LINE SOCKET


  Simple PHP paging class

Frequently in our web applications, we may have many records in the database to display. In order to imrpove loading speed and efficiency, we may need to display some records at a time, so we need to paginate the records. For example, if we have 1 million book records and when users want to view the book list, it's inefficient to display all the records on the same page, we may need to have some pagination to allow displaying a portion of the records such as 20 records per page. This is a simple PHP pagination class, here is the code.paing.php<?phpclass Paging {  public static $count =...

6,197 0       PHP CLASS PAGING


  Cron Job in cPanel with PHP

Running PHP scripts automatically can have some big benefits. You can wait to have things get done when there is less traffic on your server, or you can ensure daily tasks get done on time.cPanel Simple CronEven if you do not know anything about cron jobs, and have never run a cron job before - you can get started with the simple cron tool built into cPanel. The url for it is:https://www.yoursite.com:2083/frontend/x/cron/simplecron.html?A few things you'll need is the path to php and the path to the script that you'll be running. You will need the full path to do this. If your path to PHP diff...

5,725 0       PHP CRON AUTONOMOUS JOB CPANEL LINUX