$url = explode('/', '/article/category-5/status-2/page-3');

$params = array();

foreach ($url as $v)
{
$temp = explode('-', $v);
if (isset($temp[1]))
$params[$temp[0]] = $temp[1];
} var_dump($params);

【PHP伪静态】时获取不规则的URL参数的更多相关文章

  1. react获取当前页面的url参数

    react获取当前页面的url参数,必须在url路由对应的组件上获取,在子组件上获取不到,为undefined,获取形如  /news/:id  的后面的参数 id this.props.match. ...

  2. JS获取当前/指定URL参数

    方法: 首先通过 document.location 获得当前访问网页的网址, 其次用 split 方法通过“?”把网址分为两部分. 如果网址中有参数(arrObj.length > 1) 再用 ...

  3. js 获取对应的url参数

    举例:http://localhost:5000/?sss=sdf&fdd=123 1.设置或获取整个 URL 为字符串 window.location.href 值:  http://loc ...

  4. silverlight获取web的url参数

    1.网址(如:http://localhost:8081/index.aspx?name=123) 2.获取name=123的信息 3.IDictionary<string,string> ...

  5. 正则获取URL参数

    一 获取指定URL参数 function getUrlParams(name) { var reg = new RegExp("(^|&)" + name + " ...

  6. Angularjs中使用$location获取url参数时,遇到的坑~~~

    今天在开发时候,需要用到Angularjs1.4.6获取url参数,网上查了一下,有部分文章提到用$location来获取.大致方法如下 var app = angular.module('myApp ...

  7. js 路径改变时获取url参数

    当我们在使用react或vue的router作路由跳转时,为了保持菜单与地址栏状态一致,我们可以使用window.onhashchange捕获#后面的变化 window.onhashchange = ...

  8. [js开源组件开发]query组件,获取url参数和form表单json格式

    query组件,获取url参数和form表单json格式 距离上次的组件[js开源组件开发]ajax分页组件一转眼过去了近二十天,或许我一周一组件的承诺有了质疑声,但其实我一直在做,只是没人看到……, ...

  9. 使用jquery获取url及url参数的方法及定义JQuery扩展方法

    1.jquery获取url很简单,代码如下: window.location.href; 其实只是用到了javascript的基础的window对象,并没有用jquery的知识. 2.jquery获取 ...

随机推荐

  1. Linux入门(五)linux服务器文件远程管理

     1 使用filezila远程管理linux服务器文件 filezila下载地址:https://filezilla-project.org/ filezila默认只能登录普通用户,如果想要root用 ...

  2. 浙大pat 1037

    1037. Magic Coupon (25) 时间限制 100 ms 内存限制 32000 kB 代码长度限制 16000 B 判题程序 Standard 作者 CHEN, Yue The magi ...

  3. 1、第一个SpringMVC程序

    1.创建如下项目结构 2.在src下的com.springmvc下创建User.java package com.springmvc; public class User { private Stri ...

  4. AnimatorController动画遮罩

    游戏中,我们的人物在某些时候,可能在一个时间点在做两件事,这样就需要同时播放两个动画,但我们肯定不能简单将其叠加,比如移动着开枪.攻击.挥手等等,那么在Unity中我们应该怎样实现这样的功能呢?且听我 ...

  5. IOS 类的属性修饰符atomic

    在声明一个类的属性时,默认这个属性会被修饰atomic,意思是原子性访问的. nonatomic和atomic修饰的属性,在自己没有重写setter和getter的时候才会发生作用,其主要的作用可以理 ...

  6. LeetCode OJ 11. Container With Most Water

    Given n non-negative integers a1, a2, ..., an, where each represents a point at coordinate (i, ai).  ...

  7. linux重新部署mysql和tomcat时乱码问题

    mysql解决方法 vim /etc/my.cnf [client]default-character-set=utf8 [mysqld]default-storage-engine=INNODBch ...

  8. sqlserver 按日、周、月统计方法

    摘自于网络网络:http://blog.csdn.net/wanmdb/article/details/8080636 create table T(日期时间 datetime, 数量 int) in ...

  9. oracle导入导出数据库

    oracle导出dmp文件: 开始->运行->输入cmd->输入 exp user/password@IP地址:1521/数据库实例 file=文件所在目录 (如:exp user/ ...

  10. PHP socket模拟POST请求

    <?php if (! function_exists ( 'socket_post' )) { function socket_post($url, $data, $referer = '') ...