ตัวจัดรูปแบบและโค้ด
JSON เป็น PHP Class / DTO
Strict-typed PHP DTO classes from a JSON sample.
หมายเหตุจากบรรณาธิการ
Understanding · Modern PHP DTOs are surprisingly tight.
บทเชิงลึกนี้มีให้บริการเฉพาะภาษาอังกฤษในขณะนี้ เครื่องมือแปลงด้านบนทำงานในภาษาของคุณ บทความอธิบายแบบยาวยังไม่ได้แปล
คำถามที่พบบ่อย
Quick answers.
›Which version of PHP is supported?
The generator targets PHP 8.1 and above, utilising readonly properties, constructor promotion, and strict type hints. You can manually adjust the output for older versions if required.
›How does it handle nested objects?
Nested JSON objects are automatically identified and generated as separate, linked PHP classes. This maintains a clean, modular structure where each object has its own typed definition.
›Does it support arrays of objects?
Yes. If an array of objects is detected, the tool generates a single class definition for those items and uses array type hinting in the parent class documentation.
›Is my JSON data secure?
Yes. The parsing and transformation happen locally within your browser's memory using JavaScript. Your JSON input and the resulting PHP code are never transmitted to a server.
ผู้คนยังค้นหา
เครื่องมือที่เกี่ยวข้อง
More in this room.
- JSON เป็น TypeScript Interfaceอนุมานประเภทจากตัวอย่าง JSON และส่งออก TS interfaces
- JSON เป็น C# Classสร้างคลาส POCO จากตัวอย่าง JSON
- JSON เป็น Java POJOส่งออก Java POJO จากตัวอย่าง JSON
- JSON เป็น Python Dataclassdataclasses ที่มี type-hint (พร้อม Pydantic เสริม) จาก JSON
- JSON เป็น Go StructGo structs แบบ idiomatic พร้อมแท็ก `json:`
- JSON เป็น Kotlin Data Classdata class ที่กระชับสำหรับตัวอย่าง JSON ใดๆ