PHPackages                             waughj/html-select - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. waughj/html-select

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

waughj/html-select
==================

Simple class for easily generating select tags.

v0.1.0(6y ago)0301AGPL-3.0-or-laterPHPPHP &gt;=7.2

Since Sep 24Pushed 6y ago1 watchersCompare

[ Source](https://github.com/waughjai/html-select)[ Packagist](https://packagist.org/packages/waughj/html-select)[ RSS](/packages/waughj-html-select/feed)WikiDiscussions master Synced 2w ago

READMEChangelog (1)Dependencies (2)Versions (2)Used By (1)

HTML Select
===========

[](#html-select)

Simple class for easily generating select tags.

1st argument is an array of options, which can either be associative or linear. Associative will use the key as the value attribute &amp; value as the name, linear will use the index as the value attribute &amp; the value as the name. If it’s an array of arrays, then it will check to see if that array has “value” &amp; “name” keys &amp; try to use the values of those. To set an option as selected, add a key “selected” with the value true.

The 2nd argument is an associative list of attributes for the select tag.

Example
-------

[](#example)

```
use WaughJ\HTMLSelect\HTMLSelect;

echo new HTMLSelect
(
    [
        [ 'value' => 'one', 'name' => 'One' ],
        [ 'value' => 'two', 'name' => 'Two', 'selected' => true ],
        [ 'value' => 'three', 'name' => 'Three', ]
    ],
    [ 'class' => 'select', 'id' => 'select-1' ]
);

```

Will output:

```

    One
    Two
    Three

```

Changelog
---------

[](#changelog)

### 0.1.0

[](#010)

- Initial release

###  Health Score

21

—

LowBetter than 18% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity43

Maturing project, gaining track record

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

2471d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/11161078?v=4)[waughj](/maintainers/waughj)[@waughj](https://github.com/waughj)

---

Tags

optionsgeneratorhtmlselectdropdown box

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/waughj-html-select/health.svg)

```
[![Health](https://phpackages.com/badges/waughj-html-select/health.svg)](https://phpackages.com/packages/waughj-html-select)
```

###  Alternatives

[okipa/laravel-table

Generate tables from Eloquent models.

57153.1k](/packages/okipa-laravel-table)[airmanbzh/php-html-generator

PHP html generator

7975.1k5](/packages/airmanbzh-php-html-generator)[shish/microhtml

A minimal HTML generating library

1146.2k3](/packages/shish-microhtml)[okipa/laravel-form-components

Ready-to-use and customizable form components.

198.0k1](/packages/okipa-laravel-form-components)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
