php5

What is the simplest library for consuming wordpress xmlrpc API

Hi guys, I want to consume wordpress XMLRPC API for my latest experiment. Do you know what is the simplest library to do this? PHP4 compatibility is not important as it's obsolete anyway. ...

Simple HTML DOM Parser error handling

Hello, I'm using SimpleHTMLDOM Parser to scape a website and I would like to know if there's any error handling method. For example, if the link is broken there is no use to advance in the code and search the document. Thank you. ...

Creating classes or just using associative arrays for XML data in PHP?

From a maintenance and code organization standpoint, in PHP5, does it make sense to create/define objects and classes for XML data coming from a web service? Using Twitter's API as an example, I would have a class for each API method (statuses, users, direct_messages, etc). For statuses/public_timeline, I would have something like this...

Is there an easy way in PHP to convert from strings like '256M', '180K', '4G' to their integer equivalents?

I need to test the value returned by ini_get('memory_limit') and increase the memory limit if it is below a certain threshold, however this ini_get('memory_limit') call returns string values like '128M' rather than integers. I know I can write a function to parse these strings (taking case and trailing 'B's into account) as I have writt...

Simple(r) ORM for PHP

What is the simplest ORM implementation around for PHP? I'm looking for something really simple and light (in terms of LOC, since speed it's not crucial I don't need caches and what not), preferably a single file or class package that doesn't depends on XML or other configuration files and it's easy to deploy. Reading other similar ques...

PHP : Better date parser than strtotime

I'm trying to parse a string in a specific format and I'm really surprised to discover that I can't find a good function to do that. The only one I found is strtotime and it doesn't fit as it guesses the date format. I really don't trust the "guess" part. Moreover my string input is in a french format (dd/mm/aaaa) which it seems that it...

Is it possible to determine which php version is most widely used on paid webhosting services?

I'm assuming every modern hosting provider gives access to php5 (and i noticed that many have both 4 and 5) but now WHICH php5 is most popular... let's say i'm trying to choose between curl copy handle and curl setopt array (in my previous question)... but curl setopt array is available in php 5.1.3 while curl copy handle is available in...

Mod-Rewrite Question

Hello, I want to make a category path with pagination. URL's would be as followed; All paths should work with or without trailing slash (if possible) /category/entertainment-and-music/ /category/entertainment-and-music/music/ (represents "music" category "under entertainment and music") /category/entertainment-and-music/5/ ...

Need help with libcurl username/password authentication.

I'm trying to access a secure webpage on one of our servers. The webpage is inside a .htaccess protected directory that requires a username and password. I'm trying to get libcurl to submit the authentication request so it can access the file. After finding some guidance in various places, I've come up with what I believe should work,...

Regex to replace string1 with string2 except within html tags, OR as part of a url(outside of html)

I have a need to perform search and replace operations on large blocks of HTML. I do not wish to change anything that is part of an html tag (like urls) - I also do not wish to change urls OUTSIDE of html tags. I have a partial solution for matching a word that is not inside of html (src): word(?!([^<]+)?>) while regex buddy also say...

How to create a list of lists in PHP?

This might be basic question but how do I create a list of lists in PHP. I would like to perform the following operations: var x = List(List(1,1,1),List(2,2,2), List(3,3)) echo x[0] //prints List(1,1,1) echo x[1] //prints List(2,2,2) x = x.List(4,4,4) echo x //prints List(List(1,1,1),List(2,2,2), List(3,3),List(4,4,4)) ...

Getting size in memory of an object in PHP?

There is a way to get the total memory PHP is using (memory_get_usage()) but how does one get the size in memory of an individual object? I'm obviously not talking about count() as I want the number of bytes in a potentially complex data structure. Is this even possible? Thanks. ...

Source install Apache 2.2.13 + PHP 5.3 + Snow Leopard

Can anyone direct me to or write their experiences installing Apache and PHP on Snow Leopard? I had this working in the past on Leopard, it would die after a security update, but was as simple as: $ ./configure --enable-layout=Darwin --enable-mods-shared=all $ make $ sudo make install and I was up and running again. Since the Snow L...

Howto make MCrypt and PHP work together on CentOS

Hi all, I've installed mcrypt on CentOS ( via yum ), but when I try to do a dl() call in A), I get the message in B). A) dl( mcrypt.so ) or die('The Mcrypt module could not be loaded ['. $prefix . 'mcrypt.' . PHP_SHLIB_SUFFIX .']'); B) The Mcrypt module could not be loaded [ mcrypt.so ] Now, I know that yum has installed mcryp...

Translate Java code to PHP code (13 lines)

Hello! simonn helped me to code an ordered integer partition function here. He posted two functions: one function simply gives back the count of partitions, the second function gives the partitions as a list. I've already managed to translate the first function from Java to PHP: Java version PHP version Unfortunately, I can't manag...

Pass DotNetNuke User Information To PHP Site As Login

I've been using DotNetNuke for my company's main website. A separate vendor built a tool that we're using to sell our product. That vendor built it's application on Linux/Apache/MySQL/PHP. They use the standard forms authentication. Is it possible to create a link on my dotnetnuke site that passes some user information (e-mail addres...

Communication between two subdomains. Zend Framework.

Hey all, I'm adding a bulletin board to my Zend-driven site, and am using an open source one called Phorum. While it would be theoretically possible to integrate Phorum into my Zend site, it's already self contained, and not designed to run through a controller. My solution was to make a sub-domain for Phorum, which worked quite well...

Problem Setting Cookie w/ PHP

I'm working locally across two "domains". I have enterprise.local and application.local virtual hosts on my machine and I need to set a domain cookie for "local" or ".local" I'm having some trouble getting the cookie to set properly, though. In application.local, I have this: setcookie( 'iPlanetDirectoryPro', trim( $token_id ), '0', '/'...

Url Routing Problem in Php Symfony 1.2 Framework

i have started to learn symfony framework by reading joobet-propel book.i was in URL Routing chapter ,i tried every sample in my sample application.But it gives me error. Compeletely My issue: a small part of routing.yml file: bookmark_deneme_user: url: /post/:title_slug/:id/:summary_slug class: sfPropelRoute options:...

How can obtain the parameters in a link inside a php file?

Hi: I client of mine, have 542 php files (yes a lot) each one of them call a iframe with certain parameters every one different. So i wanna make this a little more efficent, and convert all files to a database, but for this i need to obtain 2 things The contain of the title tag One parameter of the iframe (cat) I show the iframe exa...