Love Fuel?
Donate
About
Forums
Discussions
Login
FuelPHP Forums
Ask your question about FuelPHP in the appropriate forum, or help others by answering their questions.
General
ucfirst
atabak
July 2016
hi ,
i need select list with ucfirst option text:
my code:
$query = Model_Asd::query()->select('id', array(\DB::expr('CONCAT(UCASE(MID(name,1,1)),MID(name,2))'),'name'))->get();
and then use \Arr::pluck
and then use \Form::select
(\Form::select("select_id", null, \Arr::pluck(\Acl\Model_Asd::query()->select('id', array(\DB::expr('CONCAT(UCASE(MID(name,1,1)),MID(name,2))'),'name'))->order_by('name')->get(), 'name', 'id'), array("class" => "form-control")))
is there any way to use php code for do this?
Harro
July 2016
Accepted Answer
If you have an array with key => value, you can use:
$new_array = array_map('ucfirst', $old_array);
to make all values ucfirst.
Add a Comment
Howdy, Stranger!
It looks like you're new here. If you want to get involved, click one of these buttons!
Sign In
Apply for Membership
Categories
All Discussions
5,088
General
↳ General
3,364
↳ Job Board
13
↳ Installation & Setup
214
Packages
↳ Oil
213
↳ Orm
700
↳ Auth
260
Development
↳ Tips and Tutorials
126
↳ Code share
145
↳ Applications
52
In this Discussion
Harro
July 2016