October PHP-Scripts Blog Archives

get_defined_vars returns defined variables

Today in the #scriptschool chat we talked about how to get the current defined variables used in a script. Check out the following code which illustrates the use of get_defined_vars(). The variables set will be at the end of the output:

<?php
$myname = ‘TDavid’;
$mydomains = array(‘http://www.php-scripts.com’,‘http://www.tdscripts.com/’);
$arr = get_defined_vars();
echo ‘<pre>’;
var_dump($arr);
echo ”;
?>

This is particularly useful for keypoint checking/debugging.

Apache, PHP, JSP and MySQL on Windows XP / 2000

My friend, Lestat, and I were talking earlier today about PHP and Windows earlier today and tonight in my PHP stream I noticed the following article from mpcon.org:
This is a quick guide to install and configure the Apache web-server with PHP and JSP support on a Windows XP Pro SP2 machine. I also included PHPMyAdmin, […]

Upgrading the built-in WP search

Producing search results from a Wordpress-powered blog that look like something a traditional search engine would produce is not as difficult as it might seem, thanks to a comprehensive plugin and template design. While making some changes, you can also try using a different search results algorithm than the default one.
The Search Reloaded Wordpress […]

ARSC v3.0.2 RC 2 free chat

Looking to add chat to your server? Don’t want to mess with java and IRC? Want to try a PHP/MySQL solution? ARSC could be for you.

From the 4-step installation from INSTALL docs:
- Create a MySQL database
- Provide the hostname, username, password, and database
name to allow ARSC to connect to your MySQL Server
- […]

Freeware PHP Editor: PSPad

Though the name might sound like something for a popular gaming handheld, PSPad is actually a pretty decent freeware application for editing PHP scripts in Windows.

Query results within last X days

Sometimes it is necessary to query data from the last 7 days. Here’s how to create a dynamic query inside a script using PHP / MySQL to return a list of users who last visited within X number of days (7 by default):

<?php
$now = time(); // this is the current UNIX timestamp for the server
$days […]

Anti-PHP articles

While it’s our intention to use this blog primarily for informational and educational posts and very little controversy, the whole “PHP sucks” crowd does deserve at least a small voice in any serious evaluation of PHP. One of the common slams against PHP is in developing larger websites.
Edward Martin wrote an article entitled Why Php […]