Efficient way to store data

user2632667

I have a form grouped into different days, Monday through to Thursday.

Most days contain two classes, each with 2 different available times (some only contain 1)?

bitWorking

You could do it with a multidimensional array:

<?php
echo '<pre>';
print_r($_POST);
echo '</pre>';
?>

<form method="POST" action="">
    <fieldset style="border:#00FFFF 3px solid">
        <legend>Monday</legend>

        Yoga Class: (Becc)<br>
        <input type="checkbox" name="classtimes[Yoga][monday][]" value="9am-11am">9am-11am<br>
        <input type="checkbox" name="classtimes[Yoga][monday][]" value="12pm-3pm">12pm-3pm<br>
        <br>
        Muay Thai Fitness: (Royce)<br>
        <input type="checkbox" name="classtimes[Muay Thai][monday][]" value="8am-10am">8am-10am<br>
        <input type="checkbox" name="classtimes[Muay Thai][monday][]" value="3pm-6pm">3pm-6pm<br>
    </fieldset>

    <fieldset style="border:#00FFFF 3px solid">
        <legend>Tuesday</legend>

        Yoga Class: (Becc)<br>
        <input type="checkbox" name="classtimes[Yoga][tuesday][]" value="9am-11am">9am-11am<br>
        <input type="checkbox" name="classtimes[Yoga][tuesday][]" value="12pm-3pm">12pm-3pm<br>
        <br>
        Muay Thai Fitness: (Royce)<br>
        <input type="checkbox" name="classtimes[Muay Thai][tuesday][]" value="8am-10am">8am-10am<br>
        <input type="checkbox" name="classtimes[Muay Thai][tuesday][]" value="3pm-6pm">3pm-6pm<br>
    </fieldset>


    <input type="submit">
</form>

The output would be:

Array
(
    [classtimes] => Array
        (
            [Yoga] => Array
                (
                    [monday] => Array
                        (
                            [0] => 9am-11am
                        )

                    [tuesday] => Array
                        (
                            [0] => 9am-11am
                        )

                )

            [Muay Thai] => Array
                (
                    [monday] => Array
                        (
                            [0] => 8am-10am
                            [1] => 3pm-6pm
                        )

                    [tuesday] => Array
                        (
                            [0] => 8am-10am
                            [1] => 3pm-6pm
                        )

                )

        )

)

この記事はインターネットから収集されたものであり、転載の際にはソースを示してください。

侵害の場合は、連絡してください[email protected]

編集
0

コメントを追加

0

関連記事

Is there an efficient way to store Firebase data in an arraylist and then read it?

Python most efficient way to keep sorted data

Efficient way to merge array of objects with similar data

More efficient way to fetch data from MySQL

An efficient way of removing objects from an indexedDB object store that are missing a property

Most efficient way to store values in separate bash variables

Most efficient way to store a 5 point scale in Django

Is there an 'offical' way to store data in uTouch-Apps?

What is the recommended way to store data for search in elasticsearch

any efficient way to count binary values in columns of big data table?

Efficient way to compare all columns in data table R

How to merge(efficient way) multiple data frame in one go?

More efficient way to iterate on my data (DbReader/DataSet)

Big data signal analysis: better way to store and query signal data

Efficient way to rename files

Efficient way or replacing "a" with "an"?

Efficient way of replacing character string with numeric values based on data frame "dictionary"

R data.frame: Efficient way to create counter for next change of value in column

Efficient way to create pairs of all combinations of column names as a rows in a data.frame

More efficient way to write this algorithm?

Is there more efficient way to write this SQL?

What is the best way to store e-mail accounts data used for sending mailing to customers in PHP?

What is a good way to store static data? Like items and their stats, rewarddata or waypoints on a map for a towerdefense game

Is there any other way to store data in c except in a text file or csv file?

Is there a way to pass a void function with any type and amount of arguments as an argument in a method and store it in a data member? (C++)

Is there an efficient way to do a selection statement with two variables?

Efficient way to find the difference between 2 IEnumerables

More efficient way of calculating prime factorisation?

Most efficient way of storing exact set membership?

TOP 一覧

  1. 1

    STSでループプロセス「クラスパス通知の送信」のループを停止する方法

  2. 2

    Spring Boot Filter is not getting invoked if remove @component in fitler class

  3. 3

    Python / SciPyのピーク検出アルゴリズム

  4. 4

    セレンのモデルダイアログからテキストを抽出するにはどうすればよいですか?

  5. 5

    tkinterウィンドウを閉じてもPythonプログラムが終了しない

  6. 6

    androidsoongビルドシステムによるネイティブコードカバレッジ

  7. 7

    ZScalerと証明書の問題により、Dockerを使用できません

  8. 8

    VisualStudioコードの特異点/ドッカー画像でPythonインタープリターを使用するにはどうすればよいですか?

  9. 9

    ビュー用にサイズ変更した後の画像の高さと幅を取得する方法

  10. 10

    二次導関数を数値計算するときの大きな誤差

  11. 11

    Ansibleで複数行のシェルスクリプトを実行する方法

  12. 12

    画像変更コードを実行してもボタンの画像が変更されない

  13. 13

    Reactでclsxを使用する方法

  14. 14

    Three.js indexed BufferGeometry vs. InstancedBufferGeometry

  15. 15

    __init__。pyファイルの整理中に循環インポートエラーが発生しました

  16. 16

    PyTesseractを使用した背景色のため、スクリーンショットからテキストを読み取ることができません

  17. 17

    値間の一致を見つける最も簡単な方法は何ですか

  18. 18

    reCAPTCHA-エラーコード:ユーザーの応答を検証するときの「missing-input-response」、「missing-input-secret」(POSTの詳細がない)

  19. 19

    三項演算子良い練習の代わりとしてOptional.ofNullableを使用していますか?

  20. 20

    好き/愛の関係のためのデータベース設計

  21. 21

    エンティティIDを含む@RequestBody属性をSpringの対応するエンティティに変換します

ホットタグ

アーカイブ