Online: Php Obfuscator
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;
footer text-align: center; margin-top: 2rem; font-size: 0.7rem; color: #4b556b; php obfuscator online
.stats display: flex; justify-content: space-between; margin-top: 0.8rem; font-size: 0.7rem; color: #6c86a3; obfuscateBtn
textarea width: 100%; background: #010409; border: 1px solid #2d3a5e; border-radius: 1rem; padding: 1rem; font-family: 'Fira Code', 'Cascadia Code', 'Courier New', monospace; font-size: 0.85rem; line-height: 1.5; color: #e2e8f0; resize: vertical; outline: none; transition: 0.2s; // initial stats update updateStats(inputTextarea
// MAIN OBFUSCATE ACTION async function runObfuscator() errorDiv.style.display = 'none'; let rawCode = inputTextarea.value; if (!rawCode.trim()) showError('Please enter PHP code to obfuscate.'); return; try catch (err) console.error(err); showError('Obfuscation error: ' + err.message); outputTextarea.value = '// Error during obfuscation, check original syntax.\n' + rawCode;
// ---- Helper: generate random name ---- function randName(prefix = '_') const chars = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'; let name = prefix; for (let i = 0; i < 6; i++) name += chars[Math.floor(Math.random() * chars.length)]; return name;
// ------------------- 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.