douli7841 2015-06-03 17:01
浏览 26

如何在php中取消/删除数组

Okay, I have an array that is created dependant on what data I receive back from a cURL request. I use a regex expression to grab the data I want and then place it into an array. However the data that is returned differs on every request. The problem I am facing now is in the example below. I seem the have two arrays. One containing 2 strings - which is fine. But they other is a blank/empty array.

Current structure:

array(2) { [0]=> string(1196) "
Please select your address from the list below.
Address 1
Address 2
Address 3
Address 4
Address 5
Address 6
" [1]=> string(1196) "
Different Address 1
Different Address 2
Different Address 3
Different Address 4
Different Address 5
Different Address 6
" } array(0) { }

My question is how would I go around removing/unsetting array(0) { }?

  • 写回答

2条回答 默认 最新

  • doujia5863 2015-06-03 17:05
    关注

    Use the php unset function. http://php.net/manual/en/function.unset.php

    unset($yourArrayName[0]); 
    
    评论

报告相同问题?

悬赏问题

  • ¥15 微信公众平台自制会员卡可以通过收款码收款码收款进行自动积分吗
  • ¥15 随身WiFi网络灯亮但是没有网络,如何解决?
  • ¥15 gdf格式的脑电数据如何处理matlab
  • ¥20 重新写的代码替换了之后运行hbuliderx就这样了
  • ¥100 监控抖音用户作品更新可以微信公众号提醒
  • ¥15 UE5 如何可以不渲染HDRIBackdrop背景
  • ¥70 2048小游戏毕设项目
  • ¥20 mysql架构,按照姓名分表
  • ¥15 MATLAB实现区间[a,b]上的Gauss-Legendre积分
  • ¥15 delphi webbrowser组件网页下拉菜单自动选择问题