Love Fuel?    Donate

FuelPHP Forums

Ask your question about FuelPHP in the appropriate forum, or help others by answering their questions.
ucfirst
  • 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?

  • HarroHarro
    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.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

In this Discussion