PHP function var_export()
support for Serde.
With cargo add installed run:
sh
$ cargo add -s serde_var_export
```rust use serde_derive::Serialize;
struct Foo {
names: Vec
fn main() { let foo = Foo { names: vec!["hello".toowned(), "world".toowned()], nums: vec![1, 2, 3], }; let s = serdevarexport::to_string(&foo).unwrap(); println!("{}", s); } ```
print result:
php
array(
'names' =>
array(
0 => 'hello',
1 => 'world',
),
'nums' =>
array(
0 => 1,
1 => 2,
2 => 3,
),
)
Now only support serialization, deserialization will support in future.
The Unlicense.