PHP Classes

ObjectVar: Create and assign dinamic variables

Recommend this page to a friend!
  Info   View files Example   View files View files (3)   DownloadInstall with Composer Download .zip   Reputation   Support forum   Blog    
Ratings Unique User Downloads Download Rankings
Not enough user ratingsTotal: 326 This week: 1All time: 7,181 This week: 560Up
Version License PHP version Categories
object-var 0.1GNU General Publi...5.3PHP 5, Data types
Description 

Author

This class can create any type of variables or objects dynamically.

It can create and assign object variables with names defined dynamically.

The class can also be used as service container too.

Picture of Marcelo Octane FX
Name: Marcelo Octane FX <contact>
Classes: 1 package by
Country: Brazil Brazil
Age: 51
All time rank: 3757303 in Brazil Brazil
Week rank: 411 Up35 in Brazil Brazil Up

Example

<?php
require("class.objectvar.php");
require(
"class.XMLHttpRequest.php");
//get here http://www.moonlight21.com/class-XMLHttpRequest-php
function check($method,$url,$vars=null){
   
$ajax=new XMLHttpRequest();
   
$ajax->open($method,$url,true);
   
$ajax->send($vars);
   
$response["text"]=$ajax->responseText;
   
$response["status"]=$ajax->status;
   
$response["allHeaders"]=$ajax->getAllResponseHeaders();
    return
$response;
}
echo
"<pre>";
for(
$o=1; $o<=2;$o++){
   
$url = 'http://www.proxz.com/proxy_list_high_anonymous_' . $o . '.html';

    ${
"result$o"} = check("GET",$url);
    ${
"pagina$o"} = new ObjectVar;
    ${
"pagina$o"}->create("url",$url);
   
   
//if(${"result$o"}['text']) ${"pagina$o"}->create("text",(${"result$o"}['text'])?${"result$o"}['text']:false);
   
if(${"result$o"}['status']) ${"pagina$o"}->create("status",(${"result$o"}['status'])?${"result$o"}['status']:false);
    if(${
"result$o"}['allHeaders']) ${"pagina$o"}->create("allHeaders",(${"result$o"}['allHeaders'])?${"result$o"}['allHeaders']:false);
   
    if(${
"result$o"}['text']){
       
preg_match_all("/eval\(unescape\(\'(.*)\'\)\);/sim",${"result$o"}['text'],$tmp);
       
preg_match_all( '/<td>(\d+\.\d+\.\d+\.\d+)<\/td><td>(\d+)<\/td>/sim',urldecode($tmp[1][0]), $the_proxies );
        for(
$i=0; $i<count($the_proxies[1])-1; $i++ ){
           
$all_proxies[] = $the_proxies[1][$i].":".$the_proxies[2][$i];
        }
        ${
"pagina$o"}->create("proxies",$all_proxies);
        unset(
$all_proxies);
        unset(${
"result$o"});
    }
}
for(
$p=1;$p<=ObjectVar::getNumInstances();$p++){
print_r(${"pagina$p"});
}
echo
"</pre>";
?>


  Files folder image Files  
File Role Description
Plain text file class.objectvar.php Class Create and assign dinamic vars
Accessible without login Plain text file getProxiesExample.php Example Get a list of proxies from www.proxz.com using class.ObjectVar and class.XMLHttpRequest
Accessible without login Plain text file index.php Example how to use :B

 Version Control Unique User Downloads Download Rankings  
 0%
Total:326
This week:1
All time:7,181
This week:560Up