类似jQuery的PHP接口? [英] jQuery-like interface for PHP?

查看:91
本文介绍了类似jQuery的PHP接口?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我很好奇PHP是否存在用于处理HTML / XML文件的jQuery风格的接口/库 - 特别是使用jQuery风格 selectors



我想做这样的事情(所有假设的):

 
foreach(j(div> p> a)as anchor){
// ...
}


print j(#some_id) - > html();


print j(a) - > eq(0) - > attr(name);

这些只是一些例子。



我尽可能多地使用谷歌搜索我可以但找不到我在找的东西。有人知道是否存在这样的行,或者这是我必须从头开始自己使用domxml?

解决方案



php / jquery / php / jquery / php / jquery / php / jquery / php / jquery / jquery介意其他用途。


I was curious as to whether or not there exists a jQuery-style interface/library for PHP for handling HTML/XML files -- specifically using jQuery style selectors.

I'd like to do things like this (all hypothetical):

foreach (j("div > p > a") as anchor) {
   // ...
}


print j("#some_id")->html();


print j("a")->eq(0)->attr("name");

These are just a few examples.

I did as much Googling as I could but couldn't find what I was looking for. Does anyone know if something along these lines exist, or is this something I'm going to have to make from scratch myself using domxml?

解决方案

Doing some more hunting, I think I might've found precisely what I was looking for:

phpQuery - jQuery port to PHP

Thanks everyone for your answers, I will definitely keep them in mind for other uses.

这篇关于类似jQuery的PHP接口?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆