Obfuscator Online — Php
.error color: #f87171; background: #7f1a1a30; padding: 0.4rem 1rem; border-radius: 1rem; font-size: 0.8rem; margin-top: 0.5rem;
button.primary background: linear-gradient(95deg, #2563eb, #4f46e5); color: white; box-shadow: 0 4px 12px rgba(37,99,235,0.3);
button i font-style: normal; font-weight: bold;
let obfuscated = code; // --- STRIP COMMENTS & WHITESPACE (if option enabled) --- if (optStripSpace.checked) (?<![\'"])#.*/g, ''); // remove extra whitespace (multiple spaces, newlines) but keep php tags structure obfuscated = obfuscated.replace(/\s+/g, ' ').replace(/<\?php /g, "<?php ").replace(/ \?>/g, " ?>"); // also fix semicolon spacing obfuscated = obfuscated.replace(/; /g, ';'); php obfuscator online
.sub font-size: 1rem; color: #94a3b8; border-left: 3px solid #3b82f6; padding-left: 1rem; margin-bottom: 2rem; font-weight: 400;
.panel-header h2 font-size: 1.4rem; font-weight: 600; margin: 0; display: inline-flex; align-items: center; gap: 8px;
obfuscateBtn.addEventListener('click', runObfuscator); // initial stats update updateStats(inputTextarea, inputStatsSpan); updateStats(outputTextarea, outputStatsSpan); // demo default example (set a meaningful example) const example = `<?php // Simple calculator function add($a, $b) return $a + $b; button id="obfuscateBtn" class="primary">
<script> (function() { // DOM elements const inputTextarea = document.getElementById('inputCode'); const outputTextarea = document.getElementById('outputCode'); const obfuscateBtn = document.getElementById('obfuscateBtn'); const copyBtn = document.getElementById('copyBtn'); const clearBtn = document.getElementById('clearBtn'); const errorDiv = document.getElementById('errorMsg'); const inputStatsSpan = document.getElementById('inputStats'); const outputStatsSpan = document.getElementById('outputStats');
// ------------------- CORE OBFUSCATION ENGINE ------------------ // This is a lightweight but powerful obfuscator that respects PHP syntax. // It handles variables, functions, strings, numbers, whitespace. // Note: not a full AST parser but regex + smart token simulation.
<div class="action-bar"> <button id="obfuscateBtn" class="primary">🌀 Obfuscate Now</button> <button id="copyBtn" class="secondary">📋 Copy Result</button> <button id="clearBtn" class="warning">🗑 Clear All</button> </div> 🌀 Obfuscate Now<
// Step 4: Numeric literal obfuscation: 42 -> (0x2A) or (24+18) etc if (optNumObf.checked) // Replace integer numbers (not inside strings or already obfuscated) obfuscated = obfuscated.replace(/\b(\d+)\b/g, (match, num) => let n = parseInt(num, 10); if (isNaN(n)) return match; if (n === 0 );
button.warning:hover background: #9a3412;
button.secondary:hover background: #3b4a70;
// Copy result copyBtn.addEventListener('click', async () => const code = outputTextarea.value; if (!code.trim()) showError('Nothing to copy — obfuscate something first.'); return; try await navigator.clipboard.writeText(code); const originalText = copyBtn.innerHTML; copyBtn.innerHTML = '✅ Copied!'; setTimeout(() => copyBtn.innerHTML = originalText; , 1500); catch (err) showError('Clipboard error: manual copy'); );