Magp.ie

A nest for the random, shiny, online tidbits I stumple across…

  • HOME
  • Code
  • Guides
  • Shortcuts

Posts Tagged ‘ php ’

JavaScript Tricks; URLEncode, Foreach and Remove last character

  • May 13th, 2010
  • Posted in Code

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 ]

Post XML with HTTPS Authentication using PHP and cURL

  • April 12th, 2010
  • Posted in Code

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 ]

Odd or Even Number

  • February 19th, 2010
  • Posted in Code

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 ]

Pages

  • About me…

Subscribe to this blog by email.

Top Rated

Content

aliases auto-select character set cookie cURL DOM storage encoding ExternalInterface Flash format xml HTTPS Authentication javascript jQuery Local Shared Objects LSO Mac OSX Microsoft SQL Server MySQL parse assignment value php plugin polldaddy polls Port forwarding pre tags PuTTY ratings regex regular expression revert revision rollback Service Broker SSH SVN terminal textwrangler tips UNIX Script UTF8 validate email validate url wordpress xkcd XML

Poll

Blog at WordPress.com. | Theme: Monochrome by mono-lab.