PHP Classes

String to boolean search string: Convert boolean expression to Google search syntax

Recommend this page to a friend!
  Info   View files Example   View files View files (2)   DownloadInstall with Composer Download .zip   Reputation   Support forum   Blog    
Ratings Unique User Downloads Download Rankings
Not yet rated by the usersTotal: 212 This week: 1All time: 8,340 This week: 571Up
Version License PHP version Categories
boolean-string 1.0BSD License5PHP 5, Searching, Text processing
Description 

Author

This class can convert boolean expression to Google search syntax.

It takes as parameter a text string that defines an expression that combines text values using AND, OR, NOT and XOR boolean operators.

The class converts the string to represent the same expression using the Google search syntax using quotes, braces, + and - operators.

Picture of Aditya Sarkar
  Performance   Level  
Name: Aditya Sarkar <contact>
Classes: 2 packages by
Country: India India
Age: 33
All time rank: 48527 in India India
Week rank: 420 Up26 in India India Up
Innovation award
Innovation award
Nominee: 1x

Example

<?php
require("class.boolean_string.php");

//echo $sourcestring = '"chief officer" AND "PSV" OR "platform supply"';
echo $sourcestring = '"chief officer" AND "platform AND supply" OR "psv" not iam NOT "you" and ("find" or "set") not iii and "you" or "he" AND all NOT candy AND andy and xor AND "xxor"';
//echo $sourcestring = 'xor and nor';
echo '<br>';

$boolStrObj = new StrToBooleanStr($sourcestring);
echo
$boolStrObj->convertStrToBoolean();



  Files folder image Files  
File Role Description
Plain text file class.boolean_string.php Class class boolean_string.php
Accessible without login Plain text file index.php Example index.php

 Version Control Unique User Downloads Download Rankings  
 0%
Total:212
This week:1
All time:8,340
This week:571Up