Top Left Text cha

Website Development Services

Found this at Stack Exchange... very handy!

    <form name="car_form" method="post" action="doublevalue_action.php">
            <select name="car" id="car">
                    <option value="">Select Car</option>
                    <option value="BMW|Red">Red BMW</option>
                    <option value="Mercedes|Black">Black Mercedes</option>
            </select>
            <input type="submit" name="submit" id="submit" value="submit">
    </form>

PHP action:

    <?php
            $result = $_POST['car'];
            $result_explode = explode('|', $result);
            echo "Model: ". $result_explode[0]."<br />";
            echo "Colour: ". $result_explode[1]."<br />";
    ?>
Comment (0) Hits: 445

 

var_dump(get_defined_vars());

 

void var_dump ( mixed $expression [, mixed $... ] )

This function displays structured information about one or more expressions that includes its type and value. Arrays and objects are explored recursively with values indented to show structure.

In PHP 5 all public, private and protected properties of objects will be returned in the output.

Comment (0) Hits: 1037
<?php
   $search-string = "derpity derp";
   $arr = array("http://site1.com", "http://site2.com", "http://etc.com");
   foreach ($arr as $site) {
      $contents = file_get_contents($site);
      if ( strpos($contents, $search-string) !== false ) {
         echo "$site - code found.<br />';
      }
   }
   unset($site); 
?>

Comment (0) Hits: 1102
X