Thanks very much - the if statement might need fixed as it's returning all results - but other than that it's working as I expected (you had $name twice in the strpos)
Awesome job
edit:
here is my updated code:
require_once('workflows.php');
$w = new Workflows();
$data = array(
'Web 1 Production Site' => 'http://www1.production',
'Web 2 Production Site' => 'http://www2.production',
'Web 1 Staging Site' => 'http://www1.staging',
'Web 2 Staging Site' => 'http://www2.staging',
);
$filter = "{query}";
foreach( $data as $name => $site ):
if ( $filter && ( strpos( strtolower( $site ), strtolower( $filter ) ) !== false || strpos( strtolower( $name ), strtolower( $filter ) ) !== false ) ):
$w->result( 'saved.site', $site, $name, $site, 'icon.png', 'yes', $name );
endif;
endforeach;
echo $w->toxml();