Breadcrumbs
Tag: "php"
-
Quickstart Guide to SQLite in PHP5
- Author
- Date
- Sun 1 Mar 2009 at 15:14
- Type
- Article
PHP5 includes a built-in SQLite extension that allows you to store data in a database without a standalone database server! Say good-bye to the pesky accompanying MySQL database server that you had to run alongside PHP. SQLite can help you to make your applications more portable, to avoid pesky file-based storage, and more! In this article, Matt goes through the basics you need to get started using SQLite in your PHP applications today!
-
Micro-optimisations in PHP
- Author
- Date
- Wed 11 Feb 2009 at 20:26
- Type
- Blog Entry
- Comments
- 8 comments
I'm nearing the time when I need to start benchmarking the code of a project I'm working on and I have been browsing around the web for some various tips on optimising PHP code. So far I've come across a few fairly authoritative-looking lists with up to 63 different tips for optimising PHP code (one of which is the original list with a number of new tips added). The best formatted list is at PHP Bench; however, it's a fairly limited sample. The lists at Reinhold Weber's website and Chazzucka contain significantly more tips, but don't provide…
-
50 Useful PHP Tools
- Author
- Date
- Mon 2 Feb 2009 at 8:14
- Type
- Blog Entry
- Comments
- 1 comment
Awhile ago, I found a nice web development website called Smashing Magazine. The vast majority of their content consists of top 10, top 50, and top 100 lists of information and tools that are of interest to web designers. Most of these lists are generally not of interest to me; however, one of them really stood out as being a useful list that I could use. The list is of their top 50 PHP tools, ranging from debugging tools to PHP frameworks, is particularly useful. One of my favourite tools that is listed is one that I've just began using ca…
-
Ethan's Predictions for 2009
- Author
- Date
- Sun 28 Dec 2008 at 14:07
- Type
- Blog Entry
- Comments
- 3 comments
As Matt said in his last blog post, both Matt and I are making predictions about what will happen in 2009 with technology and web development. We'll revisit both our posts at the end of next year to see who was right and who was wrong! Make sure to read Matt's post for his predictions too. OpenID Prediction: OpenID will officially die out and lose all hope of being adopted as a widespread standard. Matt predicted that OpenID would become a login method on more mainstream websites, but still lack mainstream use. My prediction is simi…
-
Coding an All-in-one RSS Feed
- Author
- Date
- Mon 20 Oct 2008 at 11:50
- Type
- Blog Entry
One of the cool new things that we have added at Lowter recently is an all-in-one RSS feed that contains both our articles and our blog entries. Granted, the feed doesn't contain "all" of Lowter's content, such as new forum threads and blog comments, but it is very encompassing nonetheless. Coding such an all-in-one RSS feed is pretty easy! First, I'm going to assume that you want to make a combined feed of both your articles and blog entries. You can easily change the code to fit whatever combining scenario you have, such as different so…
-
POST vs. GET
- Author
- Date
- Wed 3 Sep 2008 at 19:35
- Type
- Blog Entry
- Comments
- 2 comments
When I first started learning web development, I had a hard time understanding the differences between the two HTTP request methods POST and GET. Some of the early Lowter members will remember an issue with only being able to post forum posts under 2000 characters, which was a result of me accidently using GET to submit the user's posts. Matt actually spotted the issue and probably wanted to reach through the computer screen and slap me for such a naïve error. Alas, I've come quite a ways since then. Now, there is a lot of technical …
-
PHP: Determining MIME Type
- Author
- Date
- Mon 7 Apr 2008 at 12:54
- Type
- Blog Entry
PHP lacks a definite way to detect the MIME type of a file across each PHP version. Older versions of PHP use the mime_content_type() function, whereas more recent versions encourage the use of the Fileinfo set of functions. These variations present a difficulty when developing an application that must work across multiple versions and installations of PHP. In order to solve this problem, I use the following code to create a function to check the MIME type of a file regardless of the development environment: <?php // Setup replaceme…
-
Useful Function: Multiple-dimension Array Search
- Author
- Date
- Thu 31 Jan 2008 at 19:16
- Type
- Blog Entry
- Comments
- 7 comments
Awhile back I found that I really needed a way to search through multi-dimensional arrays. PHP has the in_array() function built-in to the language, but I needed a similar function that would search through an array with more than one dimension. I use the following function in_array_multiple() to get this job done and it works perfectly. It is a very simple function, but it does exactly what it needs to: <?php /** * Multiple-dimensional array search * * @param string $needle Value searching for * @param array $haystack Array…
-
Design Patterns in PHP
- Author
- Date
- Sat 8 Sep 2007 at 8:56
- Type
- Blog Entry
If you have ever picked up a book or visited a website about design patterns, it is almost certain the examples in those resources are in Java. However, Doug on the forums posted a link to the website Patterns for PHP, which focuses on design patterns in PHP. Currently they have articles on a good selection of design patterns: Singleton Registry Factory Abstract Factory Strategy Composite Decorator Lazy Initialisation Transfer Object For the most part these are the design patterns that people will use the most. If …
-
Zend Framework 1.0 RC1 Released
- Author
- Date
- Sun 3 Jun 2007 at 22:12
- Type
- Blog Entry
Zend has released the first official version of the Zend Framework for PHP. For those who do not know, one of the common criticisms of PHP is that there is no de-facto framework for PHP. The Zend Framework has been predicted to fill this void. The framework is more like a set of tools, such as the .Net framework. It is not a framework like Ruby on Rails or CakePHP. I have not had much experience using the Zend Framework yet, but I will in the near future.…
-
Global Variables
- Author
- Date
- Sun 26 Mar 2006 at 21:55
- Type
- Article
Globals are variables that can be accessed in any context of an application. Globals present the risk of creating complex and mutual dependencies, making your code twisted and tangled. Learn here about the dangers of using global variables and why/how you should dismiss them entirely.
-
Using the PHP Manual
- Author
- Date
- Thu 29 Dec 2005 at 13:07
- Type
- Article
While programming, have you ever needed a function to carry out a certain task, but you did not remember it? Where could you have found it? Learn how to navigate the function pages of the PHP manual to the fullest extent, so that you will never experience this problem again!
-
Templates With Savant 2
- Author
- Date
- Fri 25 Nov 2005 at 14:01
- Type
- Blog Entry
Templating engines are a great asset to any application or website maintained by a development team. It helps to separate design logic and presentation into two sections. This allows the developers to maintain the program and pass the final values to a template. Then the designers and webmasters can easily change the presentation without having to deal with any code. Many developers use the Smarty template engine. While Smarty offers a nice amount of features that really take templating far and beyond, it is slightly bloated. PHP itself…
-
PHP 6 Already?
- Author
- Date
- Wed 23 Nov 2005 at 14:56
- Type
- Blog Entry
- Comments
- 2 comments
The release of PHP5 was just back around the corner, and discussion of PHP6 has already began. Core PHP developers meet in Paris regarding the future of PHP. The meeting minutes have been publishing, allowing you to see PHP's potential future path. Harry Fuecks has a blog entry discussing this in great detail, if you're interested. PHP has been progressing faster than usual this year. PHP6 is plotted along the horizon, and PHP5 still has not even established itself - wow!…
-
Feature Pack: Regular Expressions
- Author
- Date
- Mon 4 Jul 2005 at 4:39
- Type
- Article
Find the resources that you need dealing with regular expressions. Discover over fifty links to articles, books, and pocket references to get you started with regular expressions in the programming language of your choice.
-
Content Negotiation
- Author
- Date
- Fri 1 Apr 2005 at 1:52
- Type
- Blog Entry
In this entry I will discuss how to use content negotiation to your advantage and offer the correct mime-type for your code to the browsers which can handle it. Last year, I only used to check the HTTP_ACCEPT header of a browser for the presence of application/xhtml+xml, which can be done easily by using: <?php if (stristr($_SERVER, 'application/xhtml+xml')) { } ?> However, conversations with others showed me that this is not the right way to do this, because if a browser adds a q value to the HTTP_ACCEPT header (like …
-
Generating Random Passwords
- Author
- Date
- Sun 30 Jan 2005 at 6:39
- Type
- Article
Have you ever needed to generate a random password, for example when a user forgets his/her password? Create a PHP function that generates random passwords with a specified amount of characters.
-
PHP Arrays
- Author
- Date
- Sun 30 Jan 2005 at 6:39
- Type
- Article
Arrays help to keep related data neatly organised. Learn how to harness the power of arrays in PHP.
-
PHP Functions
- Author
- Date
- Sun 30 Jan 2005 at 6:39
- Type
- Article
Functions are the foundation of organised procedural programming. Learn how to craft your own functions, return values from functions, and input data as parameters into functions.
-
PHP Loops
- Author
- Date
- Sun 30 Jan 2005 at 6:39
- Type
- Article
Learn about while, do...while, for, and foreach loops in PHP and how the while loop is commonly used to loop through MySQL results.
-
PHP Conditional
- Author
- Date
- Sun 30 Jan 2005 at 6:39
- Type
- Article
Use if...else and switch statements to control the flow of your PHP programs by allowing them to make condition-based decisions.
-
PHP Variables and Operators
- Author
- Date
- Sun 30 Jan 2005 at 6:39
- Type
- Article
Learn how to take advantage of variables and the different operators in PHP.
-
RSS Feeds and PHP
- Author
- Date
- Sun 30 Jan 2005 at 6:39
- Type
- Article
Know the basics of RSS and want to put it to use on your website? Learn how to use PHP to create database driven RSS feeds that are maintenance free!
-
Custom Error Pages
- Author
- Date
- Sun 30 Jan 2005 at 6:39
- Type
- Article
Create custom error pages for your website using an Apache .htaccess file and a simple PHP file.
