News Feed
Sections
News Archive


Community Events
php|tek 2008 PHP Conference



feed this:

MSBWare.com:
XML to Array
0 comments :: posted Monday April 14, 2008 @ 10:23:11
voice your opinion now!

Michael has posted a simple script today that takes in XML data and spits back out an array on the other side:

The function takes the specified XML data (which must be in valid XML format) and converts into an array. Any attributes in the XML elements are dropped an only the element values are placed in the array.

The code uses a combination of XPath, DOM, and regular expressions to parse the given XML content.

tagged with: xml translate array xpath dom regularexpression data element


Rails for PHP Developers:
Three New Articles Posted (Scope, Variables & RegEx)
0 comments :: posted Tuesday February 19, 2008 @ 08:44:00
voice your opinion now!

Mike Naberezny has posted a few more articles to the "Rails for PHP Developers" website (based on this book) covering some more of the basics.

There's three new tutorials posted:

  • Ruby Block Scope - the basics of Ruby block scope, a common point of confusion for PHP developers new to Ruby.
  • Variable Arguments - an article that shows two common API patterns found in Rails, variable arguments and option hashes, and how to implement them both in PHP.
  • Regular Expressions in Ruby - a useful reference that maps all of the common PHP regular expression functions to the equivalents in Ruby.

Check out the rest of the site for even more great content.

tagged with: rails development regularexpression variable argument scope ruby

PHP in Action Blog:
Tips for web testing
0 comments :: posted Wednesday February 13, 2008 @ 08:09:46
voice your opinion now!

On the PHP in Action Blog, there's a this post that shares some tips for testing your web applications with some simple tests.

I just started listing the techniques I've learned when writing tests to exercise the web interface of a PHP application. This is from my experience and my personal preferences; it's not the final word or necessarily right for everyone.

He suggests:

  • Use SimpleTest's Web tester if you can
  • Test the web output using regular expressions
  • Use element IDs or names to test links, forms and fields
  • Log HTTP requests in the application
tagged with: web testing unittest simpletest regularexpression http request

Reinhold Weber's Blog:
40 signs you really are a lousy PHP programmer
2 comments :: posted Friday February 08, 2008 @ 15:23:00
voice your opinion now!

Reinhold Weber has put together a list of signs (40 in all on his "programming list of shame") that you're a lousy PHP programmer. Here's a sampling:

  • don't see the need and/or benefits of a good programming IDE like Zend Studio or Eclipse PDT
  • have never used some form of version control like Subclipse
  • don't use a consistent methodology
  • don't use test-driven development
  • don't return content but echo or print it from your functions or classes
  • return HTML, not data, strings, or objects.
  • don't allow intelligent error handling
  • you think reusable software equals/requires your code to be OOP

Now granted, some of them are a bit more high level than others, but if you're not headed towards a lot of these, you might change paths, hop out of that comfort zone and branch out into the community and the language a little bit more.

tagged with: lousy programmer test optimize list oop intelligent regularexpression

SitePoint PHP Blog:
Tokenization using regular expression sub patterns
0 comments :: posted Friday January 18, 2008 @ 11:15:49
voice your opinion now!

On the SitePoint PHP blog there's a new post from Harry Fuecks talking about a replacement method using token that works a bit better than the typical regular expression method.

Promtped by a real world example, one often-overlooked feature of most regular expressions engines is how subpatterns can useful to whip up tokenizers relatively easily. The problem? I needed to match the word any of the words "Canton", "Region" or "Group" in a string and perform a follow up action depending on which matched.

His ultimate solution used a set of preg_match generated tokens to do the replaces a bit more reliably. It also makes it easy for other scripts (like his Python example) to use them too.

tagged with: regularexpression pattern token replace

Sean Coates' Blog:
PHP Pie?
0 comments :: posted Monday February 19, 2007 @ 08:20:00
voice your opinion now!

Sean Coates has created a simple version of a popular bit of Perl functionality and shares the code in hi slatest post - the "pie" ability to perform a search and replace, line by line, through a file using a regular expression.

I've often found myself looking for a PHP equivalent. Not to do simple substitutions, of course, but complex ones. And since I'm most comfortable with PHP, and a I have a huge library of snippets that I can dig out to quell a problem that I may have solved years ago, I've been meaning to fill this void for a while.

So, one evening, he came home and hashed out this version of the script. He includes the code in the post...it works on the command line and pulls in a file (though STDIN) and loops through the buffered version to perform the regex replace.

tagged with: perl pie parse regularexpression code example replace search perl pie parse regularexpression code example replace search


PHP5 conference release job cakephp book package mysql application framework security code database releases pecl zend developer zendframework PEAR ajax

All content copyright, 2008 PHPDeveloper.org :: info@phpdeveloper.org - Powered by the Solar PHP Framework