Return to Snippet

Revision: 1263
at September 27, 2006 09:13 by gdonald


Updated Code
function fortune()
{
  $html = '';

  exec( 'which fortune', $fortune );

  if( $fortune )
  {
    exec( $fortune[ 0 ], $array );
  }
  else
  {
    return '';
  }

  $x = count( $array );

  for( $q = 0; $q < $x; $q++ )
  {
    $html .= $array[ $q ] . ' ';
  }

  return $html;
}

Revision: 1262
at September 27, 2006 09:04 by gdonald


Updated Code
function fortune()
{
  $html = '';

  exec( '`which fortune`', $array );

  $x = count( $array );

  for( $q = 0; $q < $x; $q++ )
  {
    $html .= $array[ $q ] . ' ';
  }

  return $html;
}

Revision: 1261
at September 27, 2006 09:01 by gdonald


Updated Code
function fortune()
{
  $html = '';

  exec( '/usr/games/fortune', $array );

  $x = count( $array );

  for( $q = 0; $q < $x; $q++ )
  {
    $html .= $array[ $q ] . ' ';
  }

  return $html;
}

Revision: 1260
at September 27, 2006 09:00 by gdonald


Initial Code
function fortune()
{
  $html = '';
  
	exec( '/usr/games/fortune', $array );
	
	$x = count( $array );
	
	for( $q = 0; $q < $x; $q++ )
	{
		$html .= $array[ $q ] . ' ';
	}
	
	return $html;
}

Initial URL


Initial Description


Initial Title
php *nix fortune

Initial Tags


Initial Language
PHP