Happy Pi Day

Yes, it is in American date format, but close enough! 3.14159265358979323846264338327950288419716939937510582097494459230781640628620899862803482534211706798214808651328230664709384460955058223172535940812848111745028410270193852110555964462294895493038196442881097566593344612847564823378678316527120190914564856692346034861045432664821339360726024914127372458700660631558817488152092096282925409171536436789259036001133053054882046652138414695194151160943305727036575959195309218611738193261179310511854807446237996274956735188575272489122793818301194912983367336244065664308602139494639522473719070217986094370277053921717629317675238467481846766940513200056812714526356082778577134275778960917363717872146844090122495343014654958537105079227968925892354201995611212902196086403441815981362977477130996051870721134999999837297804995105973173281609631859502445945534690830264252230825334468503526193118817101000313783875288658753320838142061717766914730359825349042875546873115956286388235378759375195778185778053217122680661300192787661119590921642019…

Google Chrome Just Passed Internet Explorer To Become The World’s Most Popular Web Browser

After months of chipping away at its lead, Google Chrome has finally overtaken Internet Explorer to become most popular web browser worldwide. Chrome’s share of the market rose to 32.8% in the week ending May 20, while Internet Explorer’s share of the market dropped to 31.9%, according to new data from StatCounter, via TheNextWeb. This […]

Get the URL of a Node or Term in Drupal 7

Given a Node or Taxonomy Term – or any “entity” based object $uri = entity\_uri($entity\_type, $entity); $url = $uri[‘path’]; When you create a link with the l() function, it will link to the Clean URL for that entity (if one exists). for a Node this becomes $uri = entity_uri(“node”, $node); $url = $uri[‘path’]; of course, […]

Get the First and Last Element in a PHP Array

Get First Element $first = current(reset($ARRAY)); example $fruits = array(‘apple’, ‘banana’, ‘cranberry’); $first = current(reset($fruits)); // apple Remove The First Element $result = array_shift($ARRAY) Get Last Element $last = end($ARRAY); // cranberry example $fruits = array(‘apple’, ‘banana’, ‘cranberry’); $last = end($fruits); // cranberry Remove The Last Element $result = array_pop($ARRAY) Remove First and Last Elements […]