1. Go to this page and download the library: Download memran/marwa-support 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/ */
memran / marwa-support example snippets
bash
use Marwa\Support\Arr;
$array = ['user' => ['name' => 'John', 'age' => 30]];
// Get value using dot notation
$name = Arr::get($array, 'user.name'); // "John"
// Check if key exists
$exists = Arr::has($array, 'user.email'); // false
// Get only specified keys
$filtered = Arr::only($array, ['user.name']); // ['user' => ['name' => 'John']]
bash
// Generate a link
echo Html::link('https://example.com', 'Visit Example');
// Generate a form
echo Html::form('/submit', 'POST', [
'class' => 'my-form'
]);
// Parse HTML
$results = Html::extract($html, 'div.user > span.name');
// Generate complete document
echo Html::document('My Page', '<h1>Hello World</h1>', [
'description' => 'A test page'
]);
bash
// Finder with collection methods
$files = Finder::in('/app')
->name('.*\.php$')
->files()
->map(fn($file) => $file->getPathname())
->sortBy(fn($path) => $path)
->values();