News Feed
Sections




News Archive
feed this:

Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

PHPBuilder.com:
Using PHP Configuration Patterns Properly
April 16, 2014 @ 11:52:11

On PHPBuilder.com today they have a new post showing different configuration patterns for getting localized settings into your applications. They show the use of INI files, PHP scripts, text files, XML data and a database call.

PHP is a cross platform language. It is a server based application so we must think about the configuration settings of the PHP software. There are various ways of creating configurable PHP applications. The configuration flexibility comes as a built in feature in PHP. But we must understand the requirement clearly before making an application configurable. This article explores different PHP configuration patterns and their implementation.

For each of the options mentioned, there's a brief description of what the method is, some of the common uses and a code example showing a basic implementation. The database pattern is the only one without a code example as the database interface varies widely from application to application.

0 comments voice your opinion now!
configuration pattern ini script text xml database

Link: http://www.phpbuilder.com/articles/application-architecture/using-php-configuration-patterns-properly.html

SitePoint PHP Blog:
Translation and Text-to-Speech with Microsoft Translator
December 05, 2013 @ 09:19:29

On the SitePoint PHP blog today there's a new tutorial showing you how to combine the Microsoft Azure platform services with their Translator API to create a text-to-speech translation service with some simple curl calls.

Text to speech is a popular technique used by many websites to provide their content in an interactive way. The generation of artificial human voice is known as Speech Synthesis. Even though it's highly popular, there are very few speech synthesis services, especially when looking for those free of charge. Microsoft Translator is one of the services we can use to get a speech service with limited features. In this tutorial, we are going to look at how we can use Microsoft Translator API to translate content and then make audio files using said content.

He walks you through setting up an Azure application (you'll need an account for the marketplace already) and how to subscribe to the translation service. It's a paid service but there's a "try before you buy" level that allows 2,000,000 characters of translation before it's cut off - perfect for testing. He includes the PHP to make the requests to the Translation API via curl. Included is code to initialize the configuration for the request, get the correct tokens and a reusable method for making the actual translation request. Finally, an example of doing the actual text-to-speech conversion is shown, resulting in an mp3 file.

He also includes an example of a simple frontend UI. You can see a working demo of the script here.

0 comments voice your opinion now!
microsoft translator api texttospeech text speech tutorial azure service

Link: http://www.sitepoint.com/translation-text-speech-microsoft-translator/

PHPMaster.com:
Adding Text Watermarks with Imagick
December 31, 2012 @ 09:15:48

On PHPMaster.com there's a recent tutorial from Martin Psinas about how you can add text to an image with the help of Imagick, the image editing software that's available to PHP via an extension.

In a previous article, Timothy Boronczyk wrote about how to create watermarks with Imagick using an overlay image. In this article, I'll show you how to achieve a similar effect using plain text.

He takes a sample image (a headshot) and offers two versions of the same functionality - both the shell command (using "convert") and the PHP code that sets up the font to use, adds placement and pushes the result back out as a PNG. He also includes two other types of overlay - a font mask for a more see-through look and a tiled version, overlaying the text all over the image.

0 comments voice your opinion now!
watermark imagick tutorial text overlay mask tile


LearnComputer.com:
Sending Text Messages with PHP
September 25, 2012 @ 09:15:38

In this new tutorial on LearnComputer.com, they show you how to, using a simple call to PHP's mail function, you can send a text message to anyone.

Text messaging seems more convenient than making phone calls and creating your own PHP script to send these messages is a very easy thing to set up. Get on board with these other companies that have found how convenient text messages are for their customer and start integrating text messaging into your PHP applications. In this article, I will show you two ways to accomplish this and you will be surprised at how simple this is to do.

Once you've found the right email address for the provider, sending the message is pretty simple using mail. As an alternative, they recommend a service like TextMagic to send the messages. It's a bit more reliable and uses SMS instead of email to get your message out.

0 comments voice your opinion now!
text message email textmagic sms tutorial


PHPMaster.com:
WordPress Plugin Development
February 20, 2012 @ 10:50:39

On PHPMaster.com today there's a new tutorial showing how you can create a custom WordPress plugin for the popular PHP-based blogging/CMS tool.

If you've ever used WordPress to build a site quickly, chances are you've used one of the many plugins that are offered to extend the functionality of this popular blogging software. Plugins are one of the many things that make WordPress so attractive. [...] There are times, however, when you can't quite find what you need from existing plugins. This article will show you how to create your own WordPress plugins by walking you through an example to display some text using a widget in a the sidebar.

He walks you through all of the steps you'll need to create the plugin - making the main plugin file (definition) and using some of the methods available to create the functionality: update, form, widget and the constructor to set it all up.

0 comments voice your opinion now!
wordpress plugin development introduction simple text form


Martin Psinas' Blog:
Watermarking with text and ImageMagick
October 04, 2011 @ 11:44:35

Martin Psinas has submitted a new tutorial he's written up (complete with sample code) showing how to watermark an image with ImageMagick.

In my most recent venture with PHPMaster I was asked to write an article about watermarking images with PHP using ImageMagick. Virtually no documentation exists on the PHP API, although there are plenty of command-line examples from the official ImageMagick website. I spent a solid day and a half attempting to convert command-line code into PHP before (due to miscommunication) the topic was covered by someone else and my work was no longer needed. Although disappointed, it gave me something to blog about! Yay.

His script is pretty straight forward - it loads a sample image, sets up some watermark text and applies it with a "gravity" setting of "southwest" and adds it to the image (annotateImage). The output is pushed back out as a JPEG image. Also included is a slightly more complex example showing how to give the watermark an embossed look and a "text all over the image" look to prevent use of any part of the image, not just one section.

0 comments voice your opinion now!
watermark text image tutorial imagemagick emboss


Christian Weiske's Blog:
A MIME type for .php files
April 14, 2011 @ 09:17:06

Christian Weiske has a recent post to his site looking at something most PHP developers don't even think about when serving up their scripts - the MIME types for PHP files.

While setting some svn properties at work, we wondered about the correct MIME type for .php files.

He found several in the official IANA list including "text/php", "application/php" and "application/x-http-php" - all valid but none of them considered a standard. He talks about the ones supported by linux distributions (like Debian/Ubuntu) and some reasoning that might make "application/php" the best choice of the list. He points out some downsides to the choice, though, including the fact that something starting with "application/" should considered "machine readable" only despite PHP just being text.

0 comments voice your opinion now!
mime type application text iana linux machinereadable plaintext


Michael Maclean's Blog:
Using Pango for PHP a taster
February 22, 2011 @ 12:58:27

Michael Maclean has a new article today talking about the Pango graphics library and how it can be coupled with the Cairo PECL extension to more easily create better looking text in dynamic images.

The PECL/Cairo library is pretty good at drawing vector graphics (in our opinion, as the developers, at least!), but one thing it's not able to do by itself is draw text with mildly advanced layout. [...] That's because the developers of the Cairo library decided to let another more specialised library handle the job of text layout.

Michael has created a wrapper for Pango in PHP (github) and some sample code that can be used as a test to ensure it's all setup and working. He steps through each part of the image creation and describes what's happening and what each method is doing along the way.

0 comments voice your opinion now!
pango image creation cairo text render tutorial


NetTuts.com:
How to Send Text Messages with PHP
January 25, 2011 @ 10:14:39

On NetTuts.com today there's a new tutorial showing you how to send text messages via SMS directly from your script to the user's cell phone.

Text messaging has become extremely widespread throughout the world - to the point where an increasing number of web applications have integrated SMS to notify users of events, sales or coupons directly through their mobile devices. In this tutorial, we will cover the fundamentals of sending text messages with PHP.

Their method "cheats" a little bit and uses an interface many of the cell phone providers offer to their subscribers - a link from an email address to SMS. Most providers have their domains you can send the email to and have it automatically forwarded to the user's cell as a text. Thankfully, this requires nothing more than the mail function to accomplish. They include the sample code and HTML+CSS to make a basic form as well as mention PHPMailer as a more powerful mailing alternative.

1 comment voice your opinion now!
text message tutorial send phpmailer mail


Samuel Folkes' Blog:
The Tools You Need For PHP Development
October 17, 2009 @ 06:26:19

Samuel Folkes has posted a few of his ideas on the tool(s) that every PHP developer needs to have on his belt to make their work easy and more effective.

Quite often, I am asked the question "What tools do I need for PHP development?". [...] For those who will listen, I have one very simple answer to that question: Aside from a server running PHP and a text editor, you need absolutely nothing. That answer may seem extreme but its the truth. Lets break it down.

Samuel suggests that, while the choices for IDE, debuggers and other tools for PHP development are too many to count, nothing is as good and clean as a basic text editor (his choice is Notepad++). There are a few things that can make your code more effective like phpDocumentor or PHPUnit, but those are more about good coding practices than how you develop.

2 comments voice your opinion now!
tools development simple text ide



Community Events





Don't see your event here?
Let us know!


bugfix podcast threedevsandamaybe interview community release language framework development tips deployment series zendserver introduction api conference list code laravel symfony

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