PHP code example of raeen / phpy

1. Go to this page and download the library: Download raeen/phpy library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

raeen / phpy example snippets




use app\core\App;

$app = new App();
$python = $app->python;

$data1 = [
    'name' => 'raeen',
    'library' => 'phpy'
];
$data2 = "test";
$output = $python->set("../Python/test2.py")->send($data1, $data2)->gen();

$site = "google.com";
$python->set('../Python/test6.py')->send($data)->live()->gen();

$output = $python->set(path)->send(datas..)->gen()

$app->img($output,$type,$show,$style)

$app->img($output,$type,true,
[
    'border' => '1px solid red'
])

$app->path(__Dir__,path)

$app->ini()

$Snippet->set($code,function(){ 
    // controller 
})->gen();

$Snippet = $app->snippet;
$Snippet->set("print(f'hello world {|&data|*7*|&test|}'); print('--Hello')",
function ($data,$test) {
    $data = 2;
    $test = 9;
    $data2 = $data*5;
    return [$data2 , $test];
})->gen();


$Snippet->start(name);


$Snippet->line(code)
.
.
.


$Snippet->end(name,save_last)

$Snippet->select(name)->gen()

$Snippet->start("test");
$Snippet->line("a = 'Hello world'");
$Snippet->line("print(a)");
$Snippet->end("test");
$Snippet->select("test")->gen();


$Snippet->select("test")->gen();


$python->set("../Python/test6.py")->send($site)->live()->gen(
    function ($res) {
        return "<pre>$res</pre>";
    }
);

$python->set("../Python/test6.py")->send($site)->live()->ini(3)->gen(
    function ($res) {
        return "<pre>$res</pre>";
    }
);

$Snippet->set(
    "import subprocess as sub; sub.call('ping |&site|') ",function($site){ $site = "google.com"; return [$site];}
)->live()->ini(3)->gen();


$Snippet->select('snippet-test8')->live()->gen(function($res){ return "<b><pre>$res</pre></b>";});
 core/Python.php 
return array