I'm working with an API and it is asking me to provide a List <String>
value. I'm writing PHP and can only seem to find this type in C#.
Is it an array? A comma-separated string?
PHP does not have the concept of generic types.
You can use array():
PHP
$arr = array();
$arr[0] = 'foo';
equivalent in C#
List<string> arr = new List<string>();
arr.Add("foo");
I guess that you can use a simple array:
$list = array('string1', 'string2', 'string3');
or
$list = array();
$list[] = 'string1';
$list[] = 'string2';
$list[] = 'string3';
etc.
Check http://www.php.net/manual/en/language.types.array.php for details.
Is it an array?
Yes, it is
A comma-separated string?
No, it isn't
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With