$n = 1;
echo ( $n == 1 ? "1st" : ( $n == 2 ? "2nd" : "" ) ) . "\n";
// "1st"
$n = 2;
echo array_search( $n, array( '1st' => 1, '2nd' => 2 ) ) . "\n";
// "2nd"
here’s how to effectively convert it to an object (stdClass) and use the object property syntax instead…
$a = array( 'one' => array( 'number' => 1, 'ordinal' => '1st' ) );
echo $a[ 'one' ][ 'number' ] . "\n";
$o = json_decode( json_encode( $a ) );
echo $o->one->ordinal . "\n";
and here i thought php would supply a default value for the second parameter to fread(), namely the number of bytes to be read from an open file handle (that being the first parameter). nope! not only does this quietly surpass php’s syntax check, it causes an internal server error thus creating quite the air of mystery as to what went wrong.
09 Sep
Posted by krisgale as best practice, mysql
sitepoint recently discovered when and why row-level locking (as opposed to table-level) is sometimes a must-have…
http://www.sitepoint.com/blogs/2009/09/08/free-performance-with-mysql-table-types/
for those of you out there charged with developing/maintaining ecommerce sites using verisign/paypal’s “payflow pro” interface, be aware that as of september 1st (yes, three weeks away) older versions of their sdk will no longer be supported.
information about the upgrade (and instructions on how to perform the required code changes to your site(s)) can be found here:
http://integrationwizard.x.com/sdkupdate/step1.php
good luck.
p.s. this might be a good opportunity to switch to authorizenet since the newer payflow pro sdk uses Very Similar ‘silent’ https post’s to/from the gateway server (as opposed to an intermediary native-code binary in older versions) and might even save you/your client(s) some money, since the two gateways’ pricing structures vary when it comes to per-transaction fees and minimum/maximum sales volume thresholds. have that conversation with your merchant services provider.
| M | T | W | T | F | S | S |
|---|---|---|---|---|---|---|
| « Apr | ||||||
| 1 | 2 | 3 | 4 | 5 | ||
| 6 | 7 | 8 | 9 | 10 | 11 | 12 |
| 13 | 14 | 15 | 16 | 17 | 18 | 19 |
| 20 | 21 | 22 | 23 | 24 | 25 | 26 |
| 27 | 28 | 29 | 30 | 31 | ||