PHP Classes

File: example_search.php

Recommend this page to a friend!
  Classes of Thomas Trautner   Better PHPinfo   example_search.php   Download  
File: example_search.php
Role: Example script
Content type: text/plain
Description: Example using search()
Class: Better PHPinfo
Get information about the current PHP request
Author: By
Last change:
Date: 1 month ago
Size: 898 bytes
 

Contents

Class file image Download
<?php
/**
 * Example: Search Configuration Values
 *
 * This example demonstrates how to search for specific configuration
 * values and display the results.
 */

// Include the BetterPhpInfo class
require_once 'BetterPhpInfo.php';

// Create instance
$betterPhpInfo = new BetterPhpInfo();

/**
 * Print array as readable HTML output
 *
 * @param array $array Array to display
 * @param string $title Optional title
 */
function print_array($array, $title = 'Array') {
    echo
"<h3>$title</h3>";
    echo
"<pre style='background: #f5f5f5; padding: 10px; border: 1px solid #ddd; border-radius: 4px;'>";
   
print_r($array);
    echo
"</pre><br>";
}

// Example search
$searchTerm = 'memory';
echo
"<h2>Search Example</h2>";
echo
"Searching for: <strong>$searchTerm</strong><br><br>";

$results = $betterPhpInfo->search($searchTerm);
print_array($results, "Search Results for '$searchTerm'");
?>