php

PHP Multi Byte str_replace?

I'm trying to do accented character replacement in PHP but get funky results, my guess being because i'm using a UTF-8 string and str_replace can't properly handle multi-byte strings.. $accents_search = array('á','à','â','ã','ª','ä','å','Á','À','Â','Ã','Ä','é','è', 'ê','ë','É','È','Ê','Ë','í','ì','î','ï','Í','Ì','Î','Ï','œ','ò','ó',...

php syntax for echo javascript function

Hello, I hope somebody can help me with this little problem. The problem is that I still get confused with the syntax The php line echo's a javascript function that takes one parameter, the database value. It needs to be corrected, to get it to work. extra comma's??escaping?? I never know where exactly. while($row=mysql_fetch_array($...

Convert Curl retrieved HTML string to JSON with PHP, serve with AJAX

Hi, I am building a scraper with Javascript (AJAX; Prototype) and PHP (Curl). The url is served trough AJAX to the PHP/Curl. The response is a huge HTML string. I would like to send the string in JSON to Javascript so I can process it. If I send the raw responseText it works just fine, the html (string) get's rendered on my screen. Ho...

Where and how to set DYLD environment in Mac OS X

I'm in the middle a long quest, by now, trying to install mcrypt library to Mac OS X PHP (Previous questions here, here and here). I narrowed it down to a possible solution the includes setting a parameter in the DYLD environment (or something; I'm guessing here). Anyone has any idea where this environment is declared? Any help would b...

Group by string optimization

I'm gonna convert string to integer to optimize group by performance. What do you guys think of the idea? If applicable,then is there a built-in function to convert string to a unique integer in PHP? ...

Is Wordpress Good For building a large CMS site with many pages about over 100,000 plus?

Is wordpress a good way to build a large CMS site and is it possible to build my own PHP apps that will work with wordpres. ...

Custom library files and web application on shared hosting?

Let me put my issue defining a real scenario: I am using dedicated server where PHP and MySQL are available. My PHP include_path=/var/local/php I am developing a custom cms application, where I am writing my own library which is responsible for communicating with the database and retrieving data based on some key. My application is g...

Mysql /php - How to create 'empty' row object for caching

I'm using memcache to cache database objects, for example user rows. when a user row does not exist, I would like to create an 'empty' database object, similar to the one mysql would return for a user query, fill it with data and use it. I don't want to create a new database row for the new user at this point. (it will be created at lat...

Is there a good PHP tutorial on how to display how many members are online?

Is there a good PHP tutorial that will show you how to display how many members are online? I'm looking for a tutorial to design my own script. How many people are currently online on the given site? ...

Deployment with Capistrano

Hi guys, I am trying to get into PHP app deployment with Capistrano. I have two config files that I need to be "edited" depending on where I deploy it. It's basic stuff like database name and root url (Codeigniter). Can I make Capistrano edit specified automatically? Let's say I want to edit the following in the file /system/config/edit....

Need help with a multiple table query in mysql

I'm working on building a forum with kohana. I know there is already good, free, forum software out there, but it's for a family site, so I thought I'd use it as a learning experience. I'm also not using the ORM that is built into Kohana, as I would like to learn more about SQL in the process of building the forum. For my forum I hav...

PHP tutorial that will show you how to display your first 5 new members?

Is there a tutorial that will show you how to code your own PHP script that will display your most recent registered members? ...

PHP intl extension

Someone experienced with intl extension for PHP under Windows XP please help me find the php_intl.dll and suggest how to install. Thanks! ...

jQuery UI Dialog box after form submit

I have a form which users may submit information. The submission can be successful or it's not successful. In either case, I want a dialog box to tell the user if it was a success or not. The page loads itself on form submission. Ergo, the page is not submited through Ajax. I know how to trigger the dialogbox by clicking a button / lin...

Can I run MATLAB code on a web site?

I have a BE project whose code is in MATLAB but I need to present results on a web page. I want to know whether I can run my code directly on a web site? If not, could you tell me which language would be a better option? I'm thinking maybe ASP, HTML and PHP. ...

Validating input and returning errors with PHP and XML

I have a form with several input fields, i would like to go through and check to make sure they are all present before continuing. This is the code i am using if(isset($_POST['url'])){ $url = $_POST['url']; } else { echo "<error>no url</error></data></xml>"; exit(); } if(isset($_POST['username'])){ $username = $_POST['username']; } els...

writing to a text file in php

i have a php file A.php.Every time my page A.php is called i want it to write some data to a file. I want to appent to a existing file and not overwrite how do i do this ...

php mail function problem

I have currently the following and it's not working. (normally I have a body text and header information, but nothing works) mail("[email protected]","Nieuw offerte aanvraag","test"); We'll on my server it did because I'm running php 5 or higher, no problem there. But the contact page is from a client which runs php 4.4 I believe....

Equivalent of mysql_list_tables in PHP PDO?

When using PHP PDO to access the database, is there a way to list all the tables in a database? Something like mysql_list_tables() is whats needed. ...

"\r" in html made by cakePHP Sanitize::clean()

I used Sanitize::clean in cakePHP to sanitize user input and in result I got "\r" character. What does this character mean ("\r") ? Is there a function that does the reverse of Sanitize::clean, so I can use before outputting the data. ...