php

Using Regular Expressions to parse functions from a string in PHP

Is there a logical way to strip out function names and their arguments using Regular Expressions in PHP? Currently I have it splitting line by line so that I am able to have each function on each line for easier markup. So: doSomeFunction(arg, moreargs, stuff); breakSomething(); ini_set(include_path, /home/htdocs/); becomes array([0...

tools open source to help in search

Please Can you give me the name of tools open source witch can help somebody to search some information like google . ...

Drupal 5 Search not working on 404 pages.

I have a <?php print $search_box; ?> in my page.tpl.php page. On pages that exist, the search works, but on 404 pages, it does not. I saw some bugs/patches threads over at drupal.org for D6.15, but none of them seem to work according to the thread and they weren't really relevant to D5.x I have a theory that the because the <?php print...

How do I remove the namespaces in Zend_Soap?

Hi There I am trying to use the tranlsation webservice from MyMemory: http://mymemory.translated.net/doc/spec.php Unfortunately, Zend_Soap_Client does generate an XML reqest object that is not recognized by the service. I guess it is because of the ns1-Attribute (Namespace) within the tags. So does anyone know how to remove them? Tha...

Setting cookie for site in http and https under different subdomains in PHP

Situation: I'm trying run an https store (xcart) under one domain secure.example.com and I want to have access to a cookie it sets in http www.example.com I'm running PHP on Apache (MAMP), testing in Firefox with Firecookie The existing code sets cookies to .secure.example.com. I'm not sure if this is xcart related, but setcookie is ac...

Preparing a MySQL INSERT/UPDATE statement with DEFAULT values

Quoting MySQL INSERT manual - same goes for UPDATE: Use the keyword DEFAULT to set a column explicitly to its default value. This makes it easier to write INSERT statements that assign values to all but a few columns, because it enables you to avoid writing an incomplete VALUES list that does not include a value for each column in t...

splitting strings in php

I have some testcases/strings in this format: o201_01_01a_Testing_to_see_If_this_testcases_passes:without_data o201_01_01b_Testing_to_see_If_this_testcases_passes:data rx01_01_03d_Testing_the_reconfiguration/Retest: Actually this testcase name consists of the actual name and the description. So, I want to split them like this : o201...

Passing & in URL variable with the help of urlencode

I have done urlencode of the variable before passing to the URL http://example.com/Restaurants?alias=F%26B But when I try to print like in the page $alias = rawurldecode($_GET['alias']); echo $alias; it prints only F. How to solve this? ...

Designing a general database interface in PHP

I'm creating a small framework for my web projects in PHP so I don't have to do the basic work over and over again for every new website. It is not my goal to create a second CakePHP or Codeigniter and I'm also not planning to build my websites with any of the available frameworks as I prefer to use things I've created myself in general....

Output a php multi-dimensional array to a html table

I have been banging my head against the wall with this one for nearly a week now, and am no closer than I was the first day. I have a form that has 8 columns and a variable number of rows which I need to email to the client in a nicely formatted email. The form submits the needed fields as a multidimensional array. Rough example is belo...

Self Assessment Tests for Programmers

I want to help the Dev team identify areas of knowledge (practical and theoretical) that they can work on. Though I am big believer in focusing on people's strengths being a good programmer requires (I think) being challenged by concepts and ideas that don't always come naturally. We work largely in the web app space using PHP & MySQL ...

What frameworks should we consider for a custom web application?

A client is looking for a custom web application, which will eventually include lots of interconnected components, but the main features are: Subscription based membership as well as virtual/digital product sales Members have their own public web cookie-cutter directories (e.g., storefronts, pages, etc.) and personal member admin area....

Using Adldap php class, but getting error when looking for group user belongs to

<?php ini_set('display_errors',1); error_reporting(E_ALL); require_once('/include/adLDAP.php'); $adldap = new adLDAP(); $username = "user123"; $password = "pass123"; $authUser = $adldap->authenticate($username, $password); if ($authUser === true) { echo "<p>User authenticated successfully</p>"; ...

I need some advice from Experts on how to develop a PHP site with MySQL

Hi, I need some advice from experts :) I will develop a website using PHP and I will use also MySQL. I bought some server space from a Virtual private server including all the service needed. How should I develop the site? Shall I develop it on my machine at home (using for example Wamp), and when ready transfer all the files to the ser...

How can I search based on distance with the Google Maps API?

So here's the issue... I have a field where users can type in their address (which will be GeoCoded via Google Maps API). I have several addresses of widgets in my database (saved as address.. again can easily be geocoded). What I need is for the user to type in their address and for a list of my widgets to come up based on distance f...

Zend_Form validation problem

I am having problems getting validation to work for a form built using Zend_Form. The idea is this: I have two dropdown. One is a list of players. The other is a list of free agents who play the same position as the player. I am using an onChange javascript callback to run some Ajax code that replaces the free agent list dropdown ...

How to debug a web service written in PHP?

Hello, I've got a nice question here :) I need to debug my web service written in PHP. Its client is written in C#. After a couple of days of searching I realized this is not an easy task. At least it seems nobody knows the right solution. What is the problem in, actually? We have 2 popular PHP debugging libraries : PHP Debugger from N...

Convert from rtf 2 pdf using php

Hello, i will like to ask if there is any script or any help on how to convert rtf to pdf using a php script, Thanks ...

PHP file download header

I have developed a small download system in PHP, where files are downloaded through a proxy file. When I had to do this before, I just redirected by changing the location header; which is not what I want to do now. So, obviously, the first issue that appeared is what kind of header must I set. First of all, Content-Disposition is set as...

How to split value

Hi, I want to split value. $value = "code1.code2.code3.code4(code5.code6(arg1.arg2, arg3), code7.code8)"; I want to split like this. Array ( [0] => code1 [1] => code2 [2] => code3 [3] => code4(code5.code6(arg1.arg2, arg3), code7.code8) ) I used explode('.', $value) but explode split in parentheses value. I don't wan...