PHP allows developers to reference variables dynamically. Take the following: The $myValue echos “medal” as normal. But when using the $$ double dollar prefix it outputs “Gold”. This is the value of the $medal variable. Dynamic variables like this can be very useful. Take a use case where you query a database using SELECT *…
Read MoreTo debug a mysqli prepare statement we could place the prepare statement within an if as follows: The above can help but it often you want to see the SQL that was created by the prepare statement. Unfortunately there is no easy way to do this. However, the function below might help. You can feed…
Read MoreNote: you might find these PHP functions do what you are after as well Getting Path Information with PHP This function is designed to return the file name called by a particular URL. It can also navigate up the URL to retrieve the parent directories if more of a path is needed in your application.…
Read MoreBefore the fun begins – beware you’ll need to test this page with Chrome. This is one of those ‘pixie fairy magic’ features that get gifted to web developers from time to time. Speech input fields let you speak to the browser (yes the browser) and it will recognise what you say and enter it…
Read MoreThere is a Swansea but to get there you’ll probably need a map … a Google Map. So here are some quick examples to get you started. All of the following use Google Maps Version 3. Adding a Google Map means adding some Javascript to your page and accessing the Google Maps API. Note: When…
Read MoreEver needed to replace all the instances of a string in Javascript (or ActionScript)? This function takes three parameters, the string to find, the string to replace it, the string to search and an optional setting to toggle case sensitivity. Syntax .replaceAll(target:string, findToRemove:string, replacement:string, [caseSensitive:int=0 ]) Example function call searching the string “Bob, bob and…
Read MoreThis seemed to take a disproportionate amount of digging to find. So for future reference here is a neat Javascript number formatting function that adds commas to large numbers. Was found at http://www.mredkj.com/javascript/nfbasic.html
Read MoreIn January 2011 Google caused a storm in a tea cup when they stated their intention to remove H.264 video support from their implementation of the HTML5 <video> tag. But that doesn’t seemed to have happened. At the same time Mozilla stated their support for open standards – OGG and WebM – as opposed to…
Read MoreAdobe P P P Piss Off a Penguin With Flash it was supposed to be build once play anywhere. But having lost the Flash Player on mobile it looks like Linux users are next in line – at least in terms of a comprehensive service. I was at the London Flash Platform User Group’s event…
Read MoreWhat is JSON? JSON is Javascript Object Notation is a lightweight way to store and move data. If you are familiar with XML think of JSON as been … fitter, happier, more productive. So what is a Javascript object. Javascript objects consist of name : value pairs. They are defined within curly bracket as follows:…
Read More