PHP Bullshit Meter

PHP Bullshit Meter

Have you ever sat in a boardroom, meeting, or had to wade through pages of specs only to find that a very small percentage of the information is actually useful, and the rest is utter bullshit. This simple function provides a method to measure exactly how much BS is contained in a string. The process is quite simple in that the length of the string is measured, and a percentage calculated from the total length of the BS in the bs array. Feel free to add you own bs words to the array.


 * Function to measure bs in a string
 * @param    string     $string
 * @return    float
function bullshitMeter$string )
/*** example bs ***/
$bs = array (
'strategic fit',
'gap analysis',
'best practice',
'bottom line',
'out of the loop',
'value added',
'think outside the box',
'fast track',
'result driven',
'knowledge base',
'total quality',
'quality driven',
'touch base',
'client focus',
'ball park',
'game plan',
'independent it consultant',

/*** make the string lower case for comparison ***/
$string strtolower$string );

/*** check the length of the string ***/
$text_count strlen$string );

/*** set bs count to zero ***/
$bs_count 0;
$bs as $text )
$pos strpos($string$text ) )
/*** get the number of occurances ***/
$occurances substr_count($string$text);

/*** get the lenth of the bs ***/
$bs_count += strlen$text ) * $occurances;

/*** do the percentage ***/
$percent = (int) $bs_count/ (int)$text_count 100;

/*** round to two places ***/
return round$percent);


Example usage


/*** a string heavy in bs ***/
$string 'I bring your attention today to new benchmarks in quality driven development within the marketting sector. By adopting a proactive attitude to client relationships, we can develop a mindset with client focus as its central theme, while providing value added service guarentees that leverage new markets for us.';

$bs bullshitMeter$string );

"This string is $bs percent bullshit";



This string is 22.58 percent bullshit