Posts Tagged ‘PHP5’
PHP for Web Developers course starts soon
Written by Bean on January 3, 2009 – 8:43 amIts not too late to register for PHP 101 for Web Developers at LVS Online!
Learn how to use PHP4 or PHP5 to make your web site more dynamic and interactive. Utilize PHP to automate some of the more mundane tasks of your web site and prevent errors, all while creating a standards compliant web site.
We have changed the staffing of this course to provide a cooperative learning experience. This session of PHP 101 for Web Developers will have an assistant, an instructor and a back up instructor to help guide you through the assignments.
The online PHP classroom opens on Monday and the first lesson will be posted on 1/10/09. Registration ends soon!
Tags: Classes, PHP, PHP4, PHP5
Posted in Class Announcements, PHP | 2 Comments »
How does PHP compare to Ruby on Rails, Django, Python etc?
Written by Bean on September 26, 2008 – 7:38 pmThis question came up recently on the PHP class boards about scripts and frameworks such as Ruby, Django, Python, CakePHP and Symfony. I thought that it was worthy of some discussion here and moved the thread to the blog.
How does PHP compare to other server side languages? I’ve been reading up on it a bit, and it seems like some developers are quite antagonistic toward PHP, in favor of Django, Python, Ruby, Symfony, etc. instead. Do you favor PHP with MySQL? What do you think of Ruby on Rails or the other various combinations? I’m interested in developing web apps and am not sure where I should focus my attention. I’m new to all of this.
First, we need to make the distinction between scripting languages and frameworks. Frameworks are language specific tools that assist you in creating web applications, in particular database driven web sites. Pylons gives a good description of the components of frameworks.
- something that generates HTML
- something that reads arguments that are sent via HTTP
- something that communicates with your database
- something that contains your application logic
- something that deals with user accounts
- something that stores persistent data (like cookie-based sessions)
The big benefit to frameworks is that they come with libraries of frequently used code components that can save you hours in development time. Instead of writing something from scratch and debugging, you can pop in components and just customize arguments.
PHP frameworks include: Symfony, Zend, CakePHP, and CodeIgniter
Ruby framework is Rails
Python frameworks include: Django, Pylon, Turbogears
To utilize these frameworks, you will want to have at least a basic knowledge of the underlying scripting language. Ruby has been getting a lot of attention because it is object oriented and PHP has just recently entered the objected oriented programming (OOP) arena. Of the three, I think Python has the steepest learning curve for the base language but I have to admit that I haven’t played with it in at least two years. I think that Ruby could give PHP some competition down the road but not immediately. I see Python and Ruby being relegated to the geek corner for awhile, while PHP continues to be the predominant scripting language.
Why PHP?
- it is already installed on most web servers and works great with the most popular web server in the world, Apache. Ruby and Python often require separate installations and can be intimidating.
- PHP is widely available on inexpensive hosting plans. Since Ruby and Python usually require additional installations, web hosting accounts with these languages installed tend to be more expensive.
- Although all three languages have rich frameworks available to them, for every 10 shopping cart, forum, blog, content management, mailing list applications based on PHP you will find one or less based on Python or Ruby. It is much easier to add PHP applications to your project because you have so many choices.
- Since there are many more trained PHP developers than Python and/or Ruby developers available, PHP web applications tend to less expensive to maintain.
- Although PHP 4 was at a disadvantage, PHP 5 and 6 have greatly improved object oriented programming capabilities that challenge Python and Ruby. Although Ruby still exceeds in this regard, it is more complicated to install on a Linux system and retain all of the flexibility of the language and framework. It has a dramatically reduced number of applications to interact with as well.
This is just a brief summary of the languages and frameworks. There is considerable debate and programmers can become rabid fans of THEIR language/framework. I don’t believe there is just one answer to which is the best. I do believe that PHP is the language to start with in terms of its learning curve, its widespread use and availability, its power and scalability and the sheer demand for PHP programmers. There is an interesting blog post and discussion at Killersites that reenforces some of the arguments that we present here.
Once you have decided which language to pursue, you can start testing out frameworks. They all have their strengths and weaknesses. If you google them, you will find fans and detractors for all of them. You really need to test them out and see what matches your needs and workstyle. Other times your place of business will determine which framework they want to use. Frameworks do not necessarily play nicely with each other. As time allows we will try to post some reviews of specific frameworks. Check back later.
We welcome your thoughts and comments on this debate.
Tags: OOP, PHP5, Zend
Posted in PHP | 4 Comments »
PHP Date Formats
Written by Bean on August 10, 2008 – 11:14 pmThe table below shows the characters that may be used in the format string.
Each character represents a part of the formatting.
| Character | Description |
|---|---|
| a | “am” or “pm” |
| A | “AM” or “PM” |
| B | Swatch Internet time (000-999) |
| d | Day of the month with a leading zero (01-31) |
| D | Three characters that represents the day of the week (Mon-Sun) |
| F | The full name of the month (January-December) |
| g | The hour in 12-hour format without a leading zero (1-12) |
| G | The hour in 24-hour format without a leading zero (0-23) |
| h | The hour in 12-hour format with a leading zero (01-12) |
| H | The hour in 24-hour format with a leading zero (00-23) |
| i | The minutes with a leading zero (00-59) |
| I | “1″ if the date is in daylights savings time, otherwise “0″ |
| j | Day of the month without a leading zero (1-31) |
| l | The full name of the day (Monday-Sunday) |
| L | “1″ if the year is a leap year, otherwise “0″ |
| m | The month as a number, with a leading zero (01-12) |
| M | Three letters that represents the name of the month (Jan-Dec) |
| n | The month as a number without a leading zero (1-12) |
| O | The difference to Greenwich time (GMT) in hours |
| r | An RFC 822 formatted date (e.g. “Tue, 10 Apr 2005 18:34:07 +0300″) |
| s | The seconds with a leading zero (00-59) |
| S | The English ordinal suffix for the day of the month (st, nd, rd orth) |
| t | The number of days in the given month (28-31) |
| T | The local time zone (e.g. “GMT”) |
| U | The number of seconds since the Unix Epoch (January 1 1970 00:00:00GMT) |
| w | The day of the week as a number (0-6, 0=Sunday) |
| W | ISO-8601 week number of year, weeks starting on Monday |
| Y | The year as a 4-digit number (e.g. 2003) |
| y | The year as a 2-digit number (e.g. 03) |
| z | The day of the year as a number (0-366) |
Tags: Dates, PHP4, PHP5, Reference
Posted in PHP, Reference | No Comments »
New PHP Class for Web Developers
Written by Bean on August 4, 2008 – 12:33 amWe are pleased to announce a new PHP class designed specifically for web developers. We have totally revamped the introductory PHP course at LVS Online. It was updated for PHP5 and to meet the needs of the aspiring web developer.
Here are some of the topics that we will be covering:
- What is PHP?
- Programming basics
- PHP syntax
- Variables
- Includes
- Built-in functions
- Computer logic
- Conditional Statements
- Formatting Data
- Loops
- Debugging PHP
- Separation of Concerns
- PHP forms and form handlers
- PHP mail function
- PHP security
- PHP database entry
- PHP displaying database data
- Customized pages
Registration closes on 8/27/08. Sign up at LVS Online today!
Tags: Classes, PHP4, PHP5
Posted in Class Announcements | 11 Comments »
