TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

PHP.JS: use your favorite PHP functions client-side

43 pointsby ajbatacalmost 16 years ago

9 comments

calambracalmost 16 years ago
At one level, this horrifies me.<p>At another level, I'm always impressed by how PHPers just do it. Whatever it is, you always just seem to get from A to B and have something up and running. You guys are like the weaver ants of the programming world.
评论 #630534 未加载
评论 #630497 未加载
评论 #631177 未加载
mildweedalmost 16 years ago
I have been using this reliably for over a year now. They have the bulk of the functions already done that you'd want: <a href="http://phpjs.org/statistics/index" rel="nofollow">http://phpjs.org/statistics/index</a> . Extra nice: you can download the js one function at a time, if you so choose. Similar alternative for date(): <a href="http://www.svendtofte.com/javascript/javascript-date-string-formatting/" rel="nofollow">http://www.svendtofte.com/javascript/javascript-date-string-...</a>
评论 #631459 未加载
chimealmost 16 years ago
Thanks for posting this. Regardless of the attitude towards PHP on HN, this looks a very solid library, making my life easier. I hate having to create my own JS functions for search, replace, trim etc., let alone easy to use date functions.
评论 #631456 未加载
hellweaver666almost 16 years ago
I've been using this for a while - I'm a bit of a n00b when it comes to Javascript but have been using PHP since 2000 - it makes my life loads easier!
mgrouchyalmost 16 years ago
I don't know if I understand this. The Library is HUGE(Yes, I know you can compile your own package), the minified version is over 100KB. Thats 100KB to have JavaScript functions using PHP syntax, many of which duplicate functions that already exist as part of JavaScript.<p>I'm not down on PHP or anything, but much of this seems redundant and a waste of time.
评论 #630620 未加载
评论 #631343 未加载
dxjonesalmost 16 years ago
This is an excellent tool to get things up and running on the client side for the large number of people who are fluent and proficient in PHP.<p>Even if you are concerned about efficiency, it is still excellent as a fast prototyping method, where you get something up and running so you can interact with it, test new ideas, and so on.
jrockwayalmost 16 years ago
Reading the implementation of these functions is truly enjoyable. "echo" implements its own XML parser! (I wish I was making that up.)<p>The writing style the docs use is also nice. The developers are always referred to as "rock stars", and the examples are always in the form "If you write ..., it <i>could return</i> ...". could return? Nice.
trezoralmost 16 years ago
Not to be the hater in this thread, but I bet this was made by a bitter JS developer who saw how jQuery undid most the evils of Javascript and felt that the "damage" had to be rectified.<p>To add something constructive to the debate, I'll just toss in that this goes right in the face of good API design, not as a cheap pun because it's PHP, but because it's a PHP API transliterated into a language <i>not</i> PHP.
评论 #630658 未加载
shaunxcodealmost 16 years ago
And now that php is going to have cleaner anonymous functions we'll end up with some sort of pquery. but with more -&#62; and Array( all over the place.<p>P("db_table.name")-&#62;filter(function($x, $y){return $x &#62; $y;});