Bogiecom.com
  • About
  • Magento
  • Sitecore
  • WordPress

Monthly Archives: July 2012

Quick Recursive Array Iteration with PHP’s RecursiveArrayIterator

Posted on July 27, 2012 by bc-admin

Today I was trying to find one small variable in a massive PHP array.  However, var_dump and print_r weren’t outputting the contents of the array in a human readable way. So thanks to the RecursiveArrayIterator, I was able to spit out the variables in more legible manner.
Here’s how it went:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
function recurse_array($arr){
$iter = new RecursiveArrayIterator($arr);
echo " ";
 
while($iter->valid()){
  if($iter->hasChildren()){
    echo "<ul><li>".$iter->key()." => ";
    recurse_array($iter->getChildren());
    echo "</li></ul>";
 
  }else{
 
    echo "<ul>
<li>".$iter->key()." => ".$iter->current()."</li>
    </ul>"; }
 
    $iter->next();
  }
echo "";
} recurse_array($thearray);

Posted in Uncategorized | Leave a comment |

jQuery Regex Selector/Filter

Posted on July 18, 2012 by bc-admin

This came in handy today.

http://james.padolsey.com/javascript/regex-selector-for-jquery/

Posted in jQuery, Regular Expressions | Leave a comment |

Pages

  • About
  • Magento
  • Sitecore
  • WordPress

Archives

  • January 2017
  • December 2013
  • November 2013
  • February 2013
  • January 2013
  • August 2012
  • July 2012
  • June 2012
  • May 2012
  • November 2011
  • March 2010
  • February 2010
  • January 2010
  • December 2009
  • November 2009
  • September 2009

Categories

  • .NET
  • Air Force
  • Apache Configuration
  • Bash
  • C#
  • Comma-Delimited
  • Custom Field Validator
  • Date Format
  • Dump Files
  • Files
  • Grep
  • Grooveshark
  • HTML
  • Image Resizing
  • Imagick
  • Integration
  • jQuery
  • Konami Code
  • Linux
  • Magento
  • Magento Third Party CMS Integration
  • Mini Shuttle
  • Miva Merchant 5.5
  • MySQL
  • PHP
  • Powershell
  • Regular Expressions
  • Rename-Item
  • Sed
  • Shell Scripting
  • Sitecore
  • Strings
  • Uncategorized
  • Updating Product Attributes
  • Video Games
  • Wordpress
  • X-37
  • XML
  • YUI Konami Event

CyberChimps WordPress Themes

© 2008 - 2016 Bogiecom.com