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

SitePoint PHP Blog:
Voice controlled PHP apps with API.ai
Aug 31, 2015 @ 09:36:14

The SitePoint PHP blog has posted a tutorial showing you how to help your applications understand natural language with the help of the Api.ai service.

In this tutorial we’ll be looking into Api.ai, an API that lets us build apps which understand natural language, much like Siri. It can accept either text or speech as input, which it then parses and returns a JSON string that can be interpreted by the code that we write.

They start by explaining some of the concepts you'll need to know in using the service: agents, entities, intents, contexts, aliases and domains (each with a summary and examples). In their example, they show how to get the current time from any given places using their API. He shows you how to set up a free account and create a new agent. He then uses Guzzle (the HTTP client library) to make the request to the API with your API and subscription keys. They show the result of a query for "What's the current time in Barcelona Spain?" and how to extract the "location" value from the results. With this they then search the Google API for the local time of "Barcelona Spain". With the time in hand, they then use the responsive-voice.js library to convert the text to speech at the click of a button.

With all these concepts under your belt, they also walk you through a second application, a currency converter. It uses the same workflow as the previous example with the exception of using the CurrencyLayer.com API to perform the financial conversion. All code needed for this example is included as well. If you'd like to just jump to the end, they've also shared the complete code for both examples over on Github.

tagged: voice control api apiai tutorial localtime currency convert

Link: http://www.sitepoint.com/voice-controlled-php-apps-with-api-ai/

Three Devs & A Maybe Podcast:
I Want You Back
Nov 10, 2014 @ 09:19:34

The Three Devs and a Maybe podcast is back with their latest episode hosted by Michael Budd, Fraser Hart, Lewis Cains and Edd Mann. In episode #48, "I Want You Back", they talk about a wide range of topics including currency, git and passwords.

Two weeks in the making, we are finally back with another podcast installment. This week we touch upon the Unix philosophy, client drama, and shiny new MacBook Pros. We then move on to discuss the security concerns that have arisen from the introduction of contactless payment systems. Leading on from this we talk about the YubiKey and how it can be used to provide two-factor authentication, for services such as LastPass. Finally, we close with how 'tombstoning' your code trumps the dreaded commenting out every time.

You can listen to this latest episode either through the in-page player or by downloading the mp3 directly. If you enjoy the show, be sure to subscribe to their feed to get the latest episodes as their released!

tagged: threedevsandamaybe podcast ep48 security yubikey git currency

Link: http://threedevsandamaybe.com/i-want-you-back/

PHPSnippets.info:
Convert currencies using PHP, Google and cURL
Jul 19, 2010 @ 08:16:30

From the PHPSnippets.info site there's a recent post about using a conversion tool from Google to convert currency values from one type to another.

Just a few people know that Google have a built-in currencies calculator. (Just type 100$ in euros in Google search box if you want to test it) This calculator works very well, so what about using PHP and cURL and get this functionnality in your own web app?

The script makes a cURL request over to the Google API's calculator feature and passes in the amount to convert and the codes for the "to" and "from" (like USA, CAD or EUR). You'll need cURL support in your PHP installation to use the script, but it wouldn't be all that difficult to modify it to use a basic socket connection too.

tagged: convert currency google curl tutorial snippet

Link:

DevX.com:
Base Concepts of Internationalization in PHP
Aug 13, 2008 @ 09:37:12

The DevX website has recently posted this tutorial - a look at simple internationalization for your website.

If you develop Web applications that have an international target audience, then you have to take internationalization into account—a process that includes avoiding date/time or currency confusions and delivering all text pertinent to the user interface in the user's preferred language. Applications that can grow international traffic and improve revenue must respect their clients' needs.

They use the I18N PEAR package to handle most of the hard work and include the howto on grabbing the package, the structure and how to use it to get a country name from a code, work with the translation of numbers, currency and changing up date/time strings.

tagged: i18n internationalization tutorial concept currency datetime countrycode

Link:

Pádraic Brady's Blog:
Zend_Service_Currency Proposal
Sep 22, 2006 @ 13:27:39

Pádraic Brady, looking ahead to the work he will be doing over the next few months, is proposing on his blog about a new Zend Framework component - Zend_Service_Currency.

I did a quick check on what PHP classes are available for the purpose. There's really not a whole lot out there. There's a PEAR class along the lines I need, but it's released under the PHP License and, not to be too argumentative, I prefer non-PEAR solutions where the end-user may have no access to update PEAR.

So since the project is planned to use the Zend Framework, I shot off a mail to the Framework's fw-general mailing list to see if it would be a worthwhile contribution.

He sees that someone else had already opened a proposal for the same idea and decided to join with that group to work up the module. He also links to his original proposal and gives a brief overview of the goals of the package.

tagged: zend framework component proposal currency service zend framework component proposal currency service

Link:

Pádraic Brady's Blog:
Zend_Service_Currency Proposal
Sep 22, 2006 @ 13:27:39

Pádraic Brady, looking ahead to the work he will be doing over the next few months, is proposing on his blog about a new Zend Framework component - Zend_Service_Currency.

I did a quick check on what PHP classes are available for the purpose. There's really not a whole lot out there. There's a PEAR class along the lines I need, but it's released under the PHP License and, not to be too argumentative, I prefer non-PEAR solutions where the end-user may have no access to update PEAR.

So since the project is planned to use the Zend Framework, I shot off a mail to the Framework's fw-general mailing list to see if it would be a worthwhile contribution.

He sees that someone else had already opened a proposal for the same idea and decided to join with that group to work up the module. He also links to his original proposal and gives a brief overview of the goals of the package.

tagged: zend framework component proposal currency service zend framework component proposal currency service

Link: