Possible Duplicate:
Get first element of array
Convert array to string php
I have this array: $ tab
.
I perform a print_r()
it has just this:
Array ( [0] => integration ).
How to get the value integration without doing $tab[0]
?
you could use:
current($tab);
array_shift($tab); // if you don't need to use the array for anything afterwards
Id question why it's in an array in the first place if you don't need it to be and what the issue with using $tab[0]
is
Well... $tab[0]
would probably do what you want. I don't see why you wouldn't want that.
Anyway, getting the string should also be possible with current($tab)
.
list($integration) = $tab;
echo $integration;
//"integration"
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