{"success":true,"data":{"ext":"php","name":"PHP","description":"PHP is a server-side scripting language and file format originally created by Rasmus Lerdorf and now maintained by the PHP Group. It is used to build dynamic web pages, content management systems, web applications, and command-line automation scripts, and is commonly embedded within HTML. PHP code should be reviewed before execution because it can access files, databases, and network resources, making untrusted scripts a security risk.","mime":["text/x-php"],"risk_level":"Safe","signatures":[{"hex":"3C 3F 70 68 70","offset":0,"sources":[{"name":"Apache Tika","url":"https://raw.githubusercontent.com/apache/tika/main/tika-core/src/main/resources/org/apache/tika/mime/tika-mimetypes.xml"}]}],"related":["awk","php3","php4","pl","pm","py"],"usage":{"python":"def is_php(file_path: str) -> bool:\n    \"\"\"Check if file is a valid PHP by magic bytes.\"\"\"\n    signature = bytes([0x3C, 0x3F, 0x70, 0x68, 0x70])\n    with open(file_path, \"rb\") as f:\n        return f.read(5) == signature","node":"function isPHP(buffer: Buffer): boolean {\n  const signature = Buffer.from([0x3C, 0x3F, 0x70, 0x68, 0x70]);\n  return buffer.subarray(0, 5).equals(signature);\n}","go":"func IsPHP(data []byte) bool {\n    signature := []byte{0x3C, 0x3F, 0x70, 0x68, 0x70}\n    if len(data) < 5 {\n        return false\n    }\n    return bytes.Equal(data[:5], signature)\n}"},"category":"Source Code"}}