Archive for January, 2015

Using PHP to Split full names in to first name last name combo

Monday, January 26th, 2015

So often we find ourselves importing data that has first, middle and last names combined in one field,. This is annoying and can be corrected.

function splitName( $which, $what ){
$parts = explode(” “, $what);
$retStr = “”;
if( $which == ‘first’ ){
if( sizeof( $parts ) == 2 ){
$retStr .= $parts[0];
} else if( sizeof( $parts ) >= 3 ){
$retStr .= $parts[0] . ” ” . $parts[1];
} else {
$retStr .= $parts[0];
}
} else if( $which == ‘last’ ){
if( sizeof( $parts ) == 2 ){
$retStr .= $parts[1];
} else if( sizeof( $parts ) == 3 ){
$retStr .= $parts[2];
} else if( sizeof( $parts ) > 3 ){
// if more than 3 parts,. then the last name gets the final two parts only as the first got the first two parts
for( $i=(sizeof( $parts )-2 ); $i

Craigslist Search Tricks | Open in New Tab

Thursday, January 15th, 2015

Ever thought, damn it would be nice if links while you’re on craigslist opened in a new browser tab. Well, if you have google chrome, or mozilla firefox you can.

1) Open your Developer Tools (Usually “Ctrl” + “Shift” + “J” )
2) use some jquery to make it change the link targets
type: $(‘a’).attr(‘target’,’_newTab’);
and press enter
3) Click any link on the page, it will open in the new tab
4) Want to search more at once try http://clrds.comc/