1

私はマルチレベル配列、配列内の配列を使用しています。インデックス「|」があります フォーム要素のクローン作成のみにこれを使用していますが、フォームを保存すると、それは私のphp配列の一部になります。短いコードで削除する方法を教えてください.PHP関数「array_walk」と「array_walk_recursive」も使用しましたが、成功しませんでした。以下は配列の配列の表示です

Array
(
[banner_heading] => Get Started Here!
[banner_text] => <pre id="line1">aaaa</pre>
[banner_button] => [button_blue link="#"]Buy Now[/button_blue]
[banner_media] => image
[upload_banner] => /wp-content/uploads/2013/07/videoImg.jpg
[youtube_video] => Oo3f1MaYyD8
[vimeo_video] => 24456787
[intro_heading] => Anyone Can Accept Credit Cards with Square
[intro_text] => 
[feature_content] => Array
    (
        [1] => Array
            (
                [title] => Free Secure Card Reader
                [description] => Sign up and we’ll mail you a free card reader. The reader fits right in your pocket and securely encrypts every swipe.
                [link] => #
                [icon] => /wp-content/uploads/2013/07/cardIcon.jpg
            )

        [2] => Array
            (
                [title] => Easy Setup
                [description] => Download the free Square Register app and link your bank account. No setup fees or long-term contracts. You’ll be accepting payments on your smartphone or iPad in minutes.
                [link] => #
                [icon] => /wp-content/uploads/2013/07/easyIcon.jpg
            )

        [3] => Array
            (
                [title] => Simple Pricing
                [description] => Pay just 2.75% per swipe for all major credit cards or a flat monthly $275. No other fees—so you know exactly what you pay. Square’s pricing fits businesses of all sizes.
                [link] => #
                [icon] => /wp-content/uploads/2013/07/pricingIcon.jpg
            )

        [5] => Array
            (
                [title] => 
                [description] => 
                [link] => 
                [icon] => 
            )

        [|] => Array
            (
                [title] => 
                [description] => 
                [link] => 
                [icon] => 
            )

    )
)
4

2 に答える 2

1

unsetを使用できます:

$array; // this is your array

unset($array['feature_content']['|']);
于 2013-07-19T19:55:13.387 に答える