php

Looking for easy way to analyze var_dump (PHP) on large objects

I know (PHP's) var_dump is supposed to be "human readable" and all, but analyzing large objects is just a pain in the neck. I am struggling to make sense of a few of the large objects that are being passed around in a script that we are running. (I know that using xdebug with and IDE is a good idea, but I have not been able to get xdebu...

Should I use file_get_contents or curl for web service requests?

I have a zip code lookup service and I'm worried about any possible timeouts or the server being down. If I don't get any HTTP Response after 20-25s of the initial request I would want to respond with a JSON signifying it failed: ({ success:0 }) ...

OAuth-Wrap Beginners Tutorial

Ok im looking for beginners OAuth-Wrap tutorials. I want to know where to begin. I will be using Javascript / PHP for my coding. I want to play around with an API that uses OAuth-Wrap. If can help me that would be much appreciated :) ...

Matching Regular Expression in Javascript and PHP problem...

I can't figure out how to get the same result from my Javscript as I do from my PHP. In particular, Javascript always leaves out the backslashes. Please ignore the random forward and backslashes; I put them there so that I can cover my basis on a windows system or any other system. Output: Input String: "/root\wp-cont ent\@*%'i@$@%$...

Esyndicat usage

Hello group, I am helping out a friend with setting up a web site based on eSyndicat. Is anyone here using this platform, can questions be asked here for it? If not, can you recommend a good place for that. ...

html to text with domdocument class

How to get a html page source code without htl tags? For example: <meta http-equiv="content-type" content="text/html; charset=utf-8" /> <meta http-equiv="content-language" content="hu"/> <title>this is the page title</title> <meta name="description" content="this is the description" /> <meta name="keywords" content="k1, k2, k3, k4" />...

PROBLEM: PHP strip_tags & multi-dimensional array form parameter

I'm having problems stripping the tags from the textual inputs retrieved from my form so as to do something with them in checkout.php. The input is stored in a multi-dimensional array. Here's my form: echo '<form name="choose" action="checkout.php" method="post" onsubmit="return validate_second_form(this);">'; echo '<input ...

Single-letter prefix for PHP class constants?

I've noticed many (all?) PHP constants have a single-letter prefix, like E_NOTICE, T_STRING, etc. When defining a set of class constants that work in conjunction with one another, do you prefer to follow similar practice, or do you prefer to be more verbose? class Foo { // let's say 'I' means "input" or some other relevant word ...

PHP Access property of a class from within a class instantiated in the original class.

I'm not certain how to explain this with the correct terms so maybe an example is the best method... $master = new MasterClass(); $master->doStuff(); class MasterClass { var $a; var $b; var $c; var $eventProccer; function MasterClass() { $this->a = 1; $this->eventProccer = new EventProcess();...

problem with doctrine:build-schema

Hi, im using symfony with doctrine, and Im trying to generate the schema yml file from a db. I get an this error SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'group' at line 1. Failing Que...

Calling C/C++ library function from PHP

We have a PHP web app running on a customer's machine. For an update, we have a bit of code in C that we'd like to include as a native opaque library along with the PHP web app. How does one go about calling a C/C++ lib. function from PHP? It cannot be assumed that the PHP app, called by the web server, has any sort of permission to c...

Monitor AJAX calls via cURL

Is it possible to monitor a page's AJAX calls via cURL in PHP? For example, if I connect to a website that uses lots of AJAX to pull content, can I connect to the site via cURL, have it wait a couple of seconds until the AJAX requests are done and analyze the request that the site made? ...

php class scope when calling a non-method function not accessing all class members

So I'm using a stand alone function from within a class that that uses the class it's being called from. Here's the function function catalogProductLink($product_id,$product_name,$categories=true) { //This is the class that the function is called from global $STATE; if ($categories) { //The $STATE->category_id is the proper...

Remote SQLite manager

Does someone know of a Sqlite manager that I can put on my site, so that I can access it over the web and create/edit SQlite databases. I guess something like phpMyAdmin for MySQL. ...

PHP : Pattern Replacement Query.

Currently I have Input: e.g., '123456789'.'+'.'987654321' Desired Pattern: Output: e.g., '123456789987654321' How can I achieve this using in php ? I am not through on regex and so what regex would go in preg_replace for this ? ...

Is there an IDE for PHP where you can set breakpoints and step into the code?

Is there an IDE for PHP where you can set breakpoints and step into and render a webpage "stepwise"? And whats the "best" IDE for working with php-code? ...

Validating single form field with CodeIgniter

Is there a quick way to validate a single form field with CodeIgniter to see whether or not that field matches a set of rules? There's the $this->form_validation->run();, but that will return either TRUE or FALSE for the whole form, and that's just not what I'm looking for. For example, if I only wanted to check if the email was valid, c...

how does array_diff work?

I just wonder how array_diff() works.And obviously it couldn't work as follows function array_diff($arraya, $arrayb) { $diffs = array(); foreach ($arraya as $keya => $valuea) { $equaltag = 0; foreach ($arrayb as $valueb) { if ($valuea == $valueb) { $equalta...

Has anyone experienced curl request inconsistencies?

I'm trying to request a url but it fails and when I var dump the result of curl exec it returns false. http://mydomain.com:8807/getstate/?zipcode=22311&amp;field=statecode In the browser I can access it and it returns the correct HTTP Content Body, Content Type is text/html. If I change it to: http://mydomain.com:8807/getstate/?zipco...

Using jQuery in MySQL php

I am new to using Jquery using mysql and PHP. I am using the following code to pull the data. But there is not data or error displayed. JQUERY: <html> <head> <script> function doAjaxPost() { // get the form values var field_a = $("#field_a").val(); $.ajax({ type: "POST", url: "serverscript.php",...