Posts Tagged ‘ php ’
I have come across some neat (if not mind blowing) tricks with JavaScript recently. Firstly, I needed JavaScript code that copied PHP’s urlencode(). This function returns an encoded string where all non-alphanumeric characters except - _ . are replaced with a percent (%) sign followed by two hex digits and spaces encoded as plus (+) [ READ MORE ]
Recently I needed to post XML to a particular API and this API required HTTPS authentication. So I needed to send a username / password with the request. This was pretty straightforward in C#.NET ( at least from my foggy memory ). You needed to use NetworkCredentials. But it was a bit difficult to find [ READ MORE ]
I love gems like this. I come across them from time to time but they never stick… then I do a search to find them again. Anyway a simple way to determine if a number is odd or even, use the following code. function is_odd( $number ) { return $number & 1; } Quick explanation [ READ MORE ]
Subscribe to this blog by email.