-2

I have the following the array:

Array
(
    [0] => Array
        (
            [content_id] => 2489
            [author_id] => 5
            [category_name] => Customer Experience
            [vanity_url] => launching-reviews-the-decisive-marketing-software-evaluation-platform
            [title] => Launching ‘Reviews’ – the Decisive Marketing Software Evaluation Platform
            [content_image] => 55819897a71ab751db8b552d2d8a0728.jpg
            [info_type] => N
            [publish_date] => 2016-02-16 19:01:00
            [subcat_vanity_url] => customer-experience
        )

[1] => Array
    (
        [content_id] => 2407
        [author_id] => 5
        [category_name] => Sales Enablement
        [vanity_url] => 6-steps-required-to-build-an-account-based-marketing-plan
        [title] => 6 Steps Required To Build An Account Based Marketing Plan
        [content_image] => dreamforce_guest_post_1_57f220de2fa70.jpg
        [info_type] => A
        [publish_date] => 2016-02-08 18:21:00
        [subcat_vanity_url] => sales-enablement
    )

[2] => Array
    (
        [content_id] => 2450
        [author_id] => 5
        [category_name] => Content Marketing
        [vanity_url] => what-is-content-chaos-and-how-to-tackle-it
        [title] => What is Content Chaos and How To Tackle It?
        [content_image] => dreamforce_guest_post_1_57f2212e48557.jpg
        [info_type] => A
        [publish_date] => 2016-02-12 16:22:00
        [subcat_vanity_url] => content-marketing
    )

[3] => Array
    (
        [content_id] => 2711
        [author_id] => 4880
        [category_name] => Content Marketing
        [vanity_url] => this-is-test-for-single-double-quotes-title
        [title] => This is test for 'single' & "double" quote's - Title ~ ! @ # $ % ^ & * ( ) _ +
        [content_image] => handimgnew_5892fd0eb9775.jpg
        [info_type] => A
        [publish_date] => 2017-02-02 15:04:06
        [subcat_vanity_url] => content-marketing
    )
)

But I want to make key no 2 as blank

Array
(
    [0] => Array
        (
            [content_id] => 2489
            [author_id] => 5
            [category_name] => Customer Experience
            [vanity_url] => launching-reviews-the-decisive-marketing-software-evaluation-platform
            [title] => Launching ‘Reviews’ – the Decisive Marketing Software Evaluation Platform
            [content_image] => 55819897a71ab751db8b552d2d8a0728.jpg
            [info_type] => N
            [publish_date] => 2016-02-16 19:01:00
            [subcat_vanity_url] => customer-experience
        )

[1] => Array
    (
        [content_id] => 
        [author_id] => 
        [category_name] => 
        [vanity_url] => 
        [title] => 
        [content_image] => 
        [info_type] => 
        [publish_date] => 2017-02-02 15:04:06
        [subcat_vanity_url] => 
    )

[2] => Array
    (
        [content_id] => 2407
        [author_id] => 5
        [category_name] => Sales Enablement
        [vanity_url] => 6-steps-required-to-build-an-account-based-marketing-plan
        [title] => 6 Steps Required To Build An Account Based Marketing Plan
        [content_image] => dreamforce_guest_post_1_57f220de2fa70.jpg
        [info_type] => A
        [publish_date] => 2016-02-08 18:21:00
        [subcat_vanity_url] => sales-enablement
    )

[3] => Array
    (
        [content_id] => 2450
        [author_id] => 5
        [category_name] => Content Marketing
        [vanity_url] => what-is-content-chaos-and-how-to-tackle-it
        [title] => What is Content Chaos and How To Tackle It?
        [content_image] => dreamforce_guest_post_1_57f2212e48557.jpg
        [info_type] => A
        [publish_date] => 2016-02-12 16:22:00
        [subcat_vanity_url] => content-marketing
    )

)

How can I do like this?

Manish Jesani
  • 1,339
  • 5
  • 20
  • 36

1 Answers1

-1

If you want to put some value or make empty to particular array index, use like this;

$array[$indexNo] = '';

To access in-depth value:

$array[$indexNo]['content_id'];
Rachel Gallen
  • 27,943
  • 21
  • 72
  • 81
Zubair Ahmed
  • 44
  • 11