From this array:
array(3) {
["news_status"]=> string(1) "1"
["news_input_title"]=> string(10) "test title"
["news_input_description"]=> string(61) "<p>test description over 20 symbols<br></p>"
}
I want to get
["news_status"]=> string(1) "1"
but to look exactly same (to be array(1)), something like this :
array(1) {
["news_status"]=> string(1) "1"
}
most functions like reset, current get only value ..
foreach($array as $key=>$value)$result = array_slice($array, 0, 1, true);This is a pretty strange thing to want to do though - if you always want the first element, then you must know which key it is, or it wouldn't be any use.