Monthly Archives: October 2012

Format number with decimals without rounding

Description: Trying to get a precise number of decimal in a number results most of the times in a rounding of the number. Both┬áround() and┬ánumber_format() functions of PhP round the output result. Solution: The solution to this issue is to … Continue reading

Posted in Best practices, PhP | Tagged , , , | 2 Comments

301 and 302 redirect, differences and implementation

Description: Is there any difference between 301 and 301 redirects ? Solution: Practically, there is limited difference between the two. To be precise, 301 redirect signals a permanent move of the page, while 302 reffers to a temporary move. This … Continue reading

Posted in Best practices, PhP, Script, Tools | Tagged , , , | Leave a comment

Convert StdClass objects to SOAP compliant objects

Description: Having an obtained StdClass Object, we require to change it into a SOAP structure object or Array compliant. Solution: Converting a StdClass Object with PhP basically means iterating the object and populating the public properties with elements from the … Continue reading

Posted in Best practices, PhP | Tagged , , , , | Leave a comment

Update database table depending on result from SELECT with CASE clause

Description: How to update a database table depending on a query on another or several tables ? Solution: If you want to make a script that does this, it’s very easy, just select all the values you need, and then … Continue reading

Posted in Best practices, SQL | Tagged , , , | Leave a comment