PHP+GD

What is the best php framework to begin with? CodeIgniter is the answer

CodeIgniter is a powerful PHP framework with a very small footprint, built for PHP coders who need a simple and elegant toolkit to create full-featured web applications. If you’re a developer who lives in the real world of shared hosting accounts and clients with deadlines, and if you’re tired of ponderously large and thoroughly undocumented frameworks
CodeIgniter is right for you if…

* You want a framework with a small footprint.
* You need exceptional performance.
* You need broad compatibility with standard hosting accounts that run a variety of PHP versions and configurations.
* You want a framework that requires nearly zero configuration.
* You want a framework that does not require you to use the command line.
* You want a framework that does not require you to adhere to restrictive coding rules.

* You are not interested in large-scale monolithic libraries like PEAR.
* You do not want to be forced to learn a templating language (although a template parser is optionally available if you desire one).
* You eschew complexity, favoring simple solutions.
* You need clear, thorough documentation.

CodeIgniter Current Version

CodeIgniter is currently at Version 1.7.2.

Version 1.7.2

Welcome to CodeIgniter

CodeIgniter is an Application Development Framework – a toolkit – for people who build web sites using PHP. Its goal is to enable you to develop projects much faster than you could if you were writing code from scratch, by providing a rich set of libraries for commonly needed tasks, as well as a simple interface and logical structure to access these libraries. CodeIgniter lets you creatively focus on your project by minimizing the amount of code needed for a given task.

Who is CodeIgniter For?

CodeIgniter is right for you if:

  • You want a framework with a small footprint.
  • You need exceptional performance.
  • You need broad compatibility with standard hosting accounts that run a variety of PHP versions and configurations.
  • You want a framework that requires nearly zero configuration.
  • You want a framework that does not require you to use the command line.
  • You want a framework that does not require you to adhere to restrictive coding rules.
  • You are not interested in large-scale monolithic libraries like PEAR.
  • You do not want to be forced to learn a templating language (although a template parser is optionally available if you desire one).
  • You eschew complexity, favoring simple solutions.
  • You need clear, thorough documentation.
By programming on November 21, 2010 | PHP+GD | A comment?

A Must have PHP snippets that make your life easy

PHP snippets

By programming on November 20, 2010 | PHP, PHP+GD | A comment?

A must practices for PHP Beginners

by Eric Bannatyne.

In PHP, and really in just about every programming language in existence, there are certain things that are important to remember. Some of them are very general and can be applied to almost all programming languages, while others are best associated with one specific programming language.

In this post you will find nine PHP best practices that everyone really should follow.

You can also take a look at a couple of other “best practices” articles, previously from FWebDe:

* HTML Best Practices
* CSS Best Practices

Avoid Using Short Tags

We all know what they look like. Various forms of PHP short tags exist, such as and
. These should be avoid at all costs, for multiple reasons.

The first reason is that they can get in the way of certain XML parsers, potentially causing a whole bunch of problems. The second reason is that they can be disabled in certain server configurations, making your code less portable.
Be As Strict As Possible

In other words, don’t let the PHP interpreter pick up the slack for you. It is always best to try to be as strict as possible. Certain things may not cause errors, but they are generally bad coding practices. Here is an example:

$foo = array();
$foo[bar] = 3;
?>

Can you spot the problem in this example?

The array index is not surrounded with quotes ($foo[bar]). When executed, this may not raise any errors, but it is a bad programming practice, as array indices in PHP are supposed to be surrounded in quotation marks.

Another example of not being strict enough would be using PHP short tags, as above.
Comment Your Code

Make sure that you leave some comments inside of your source code, to help explain certain parts that might be a bit more difficult to understand just from looking at the code itself. This will also help out a lot when you have to go back and maintain a project from a long time ago, so that you will know what is going on.

That said, do not go and add a comment to every line. There is a point where too many comments negatively impacts your code’s readability. As a general rule, if you start to have more lines of comments than actual code, you’re doing it wrong.

Keep Loops As Simple As Possible

This is a very important thing to remember. By keeping your loops as simple as possible, you can greatly speed up the execution of your program. Here is an example of what not to do:

while ($c == $someValue) {
$a = hugeFunction(); // Note: does not change with each iteration
echo $c + $a;
}

Assuming that the result of hugeFunction() stays the same every time, and takes a long time to execute, it can have a huge impact on performance. In this example, hugeFunction() is called at every iteration of the loop, increasing the amount of time it takes each time. Here is a much better example:

$a = hugeFunction();

while ($c == $someValue) {
echo $c + $a;
// blah
}

Setup Your Own Testing Server

You can really develop much more quickly if you have your own testing server setup, so that you don’t have to worry about uploading your files to a server after each change. I also feel that having my own testing server setup on my own computer is much easier than editing files remotely.

This is made easy with XAMPP. It is a cross-platform distribution of Apache, including MySQL, PHP, Perl and various tools such as phpMyAdmin. Setup is very easy, download the distribution and extract it. From there, just move your files into the appropriate directory and you’re ready to go!
Improve Your Code Readability

When you first start out writing programs, you’re probably going to be spending almost all of the time typing out the actual code, not worrying about readability, just typing it out in a way that comes to you as you go along. Take this for example:

function echoStuff() { echo 'stuff'; echo 'not really! haha'; } if(1==1) {
echoStuff(); $a = 3;
echo $a;
}
else {$a = 5; echo $a; echoStuff(); echo 'foo';} ?>

Not only is this completely unreadable, but it is inconsistently unreadable. Certain things are indented differently, and certain lines contain many statements while others contain only one. Probably the most important part of code readability is consistency. Pick a certain style and stick to it.

If you could read that example above just perfectly, you may want to consider seeking professional help.

For more detailed tips on improving code readability, check out Tips to Improve Your Code Readability Today.

Of course if you want to go out of your way to torture others, check out a different article: How to Write Completely Unreadable Code.
Prefer Single Quoted Strings When Possible

$a = ‘asdf’;
$b = “asdf’;

There may not be much of a difference, right? Well, the difference may be small, but you should generally give preference to single quoted strings as much as possible. In PHP, double quoted strings are searched through for variables, which can waste time if done unnecessarily. Here is a better way to insert variables into strings:

$a = ‘asdf’;
$b = ‘asdf ‘ . $a . ‘ asdf’; // asdf asdf asdf

However if you are using echo, there is an even faster way:

echo ‘asdf ‘, $a, ‘ asdf’;

An uncommon way of using echo is to use it more like a function. When using the string concatenation operator (.), the entire string is added together, and then output. This other way, however, is faster because no string operations are performed, one parameter is simply output after another.
Try a Framework

Once you have learned the basics of PHP and can get the hang of creating simple applications, you may want to try out a PHP framework. There are many different PHP frameworks that include tons of different tools to help create applications much more quickly, such as database classes, various helpers, and more.

Not sure which framework to choose? There are many options to choose from, some of which are outlined in this list of popular web development frameworks.

Personally, my favourite PHP framework is CodeIgniter. It is fast and lightweight, and very easy to setup for beginners. To get started with CodeIgniter, check out an Introduction to CodeIgniter.

But make sure that you at least know the basics of PHP before diving into the framework. It is important to first understand how the PHP code itself works.
Use the PHP Manual

The PHP Manual is pretty much the official guide to PHP. Here you will find excellent documentation for just about every aspect of the language, from a guide to the syntax, to the function reference.

When you search Google for information about a specific PHP function, you will most likely get a page in the PHP function reference as the first result. For each function included, you will find a description of the function and what it does, how the function should be used, and usually a helpful example.

Do you follow these PHP best practices? Do you have any others that you would like to share? Be sure to leave a comment.

By programming on | PHP, PHP+GD | A comment?

PHP+GD programming Compiler, Source code and Tutorial

PHP+GD programming is is an artificial language designed to express computations that can be performed by a machine, particularly a computer.

Compiler

Download PHP+GD programming compiler.

Source code

PHP+GD programming Hello world sample source code.

Tutorial

PHP+GD programming tutorial.

The fundamentals of creating an image in PHP using GD Library support. This tutorial shows you how to create a simple image with welcome text and a name to follow. For example, ‘Welcome to PHPAcademy, Alex’

Lets get it on! We are engaged in a battle that pits the old way of creating web services versus the new way. In the video series, two fighters go toe-to-toe, or rather keyboard-to-keyboard to highlight the benefits of using Windows Communication Foundation (WCF) to build robust web services. Enjoy Round 1. You can find the second video here: www.youtube.com .

Google Tech Talk June 11, 2010 ABSTRACT Presented by Paul Bakaus. There are many professional game engines out there for consoles, PCs, and mobile handhelds. However, there is one big empty gap, even in 2010: Not a single game engine targets desktop and mobile browsers natively without the use of plugins. In this session, Paul will talk about the challenges of building a pure browser-based gaming engine, how web programming concepts like event-driven architecture need to be considered, and what it means to fully utilize the open web stack—HTML5, client- and server-side JavaScript, external Stylesheets, server-side JavaScript and, of course, Canvas—to squeeze every millisecond of rendering time. We will go into the details of our own upcoming Aves Engine for isometric real-time games and will give you a very solid idea of what needs to be done to build graphically rich, real-time, full featured games for the web. Paul Bakaus is the CTO of the Germany-based startup Dextrose AG, and his corporate work mostly focuses on UX, UI and tricky JavaScript challenges. He is best known for creating jQuery UI, the popular official UI framework for jQuery, where he was the driving force behind many of its plugins.
Video Rating: 4 / 5

Я очень рад, ведь я, наконец, возвращаюсь домой. Оригинальный клип. Исполняет Эдуард Хиль.
Video Rating: 4 / 5

By programming on October 16, 2010 | PHP+GD | A comment?
Tags: , , , , ,