What are the best resources do you recommend for learning php debugging?
Is there any specific book, screencast, blog post or article that you really found useful?
I have some strings that need a-strippin':
ÜT: 9.996636,76.294363
Tons of long strings of location codes. A literal regex in PHP won't match them, IE
$pattern = /ÜT:/;
echo preg_replace($pattern, "", $row['location']);
Won't match/strip anything. (To know it's working, /T:/ does strip the last bit of that string). What's the encoding error doing on here?
Alternately, I would accept a concise way to take out just the numbers.
I need to replace url invalid characters with something url valid then convert it back again.
This is for a search page with a url like http://my.site/search/this-is-a-search, the search form POSTS then the user redirected to the new url.
Php has functions urlencode and urldecode however these do not work at all, and leave invalid characters in my url.
Surely I don't need to reinvent the wheel here.
Hello! can anybody help me with a simple script wrote in php to upload an image to imageshack or similar? i found some scipts aroud but they dont work, so if you wrote one o found one please send it to me with a working html form. Thanks!!!!
I'm currently working on my company's in-house CMS and wish to add the ability for an admin to view the site on a specific date. This will allow admins to preview the site with archived or scheduled posts.
I'd like to avoid finding all mentions of date() or time() and offsetting them. Is there a way of making PHP think it's a specific date so that all calls to date() default to the new time?
Thank you
I have this text:
Lorem ipsum dolor sit
{something.something({print.print(param1,param2)},param2)},
consectetur adipiscing elit.
Where i need a pattern that can replace everything but: something.something
The text something.something can contain [a-zA-Z.]
(I am using preg_replace)
Here is a site where you can test the code: http://www.spaweditor.com/scripts/regex/index.php
I am trying to convert a block of text that contains html text - i'd like to find all http links and convert them for link tracking purposes.
So eg anything like this in a string would be converted to the latter
<a href="http://www.google.com">Some Link</a>
<a href="http://www.mysite.com/tracking.php?url=www.google.com">Some Link</a>
Can anyone how to do this taking into account the original string will consists of all sorts of html, images etc..
Hi
I am trying to get the IP address of the website visitor in PHP. I'm expecting $_SERVER['REMOTE_HOST'] to return something like 127.0.0.1, but it's returning ::1.
Kind regards
Peter
I need to read a file in PHP, but I only know the end of the filename, so I need to serch the file in a given directory using wildcards: *filename.wav and then return it to the browser.
Is there a function to do that? or I need to get all the files in the directory and then search one by one?
Thanks for all the comments and help.
Yo. I'm trying to make a simple login system in PHP and my problem is this: I don't really understand sessions.
Now, when I log a user in, I run session_register("user"); but I don't really understand what I'm up to. Does that session variable contain any identifiable information, so that I for example can get it out via $_SESSION["user"] or will I have to store the username in a separate variable? Thanks.
Hi,
I'm looking for a way to extract some information from this site via PHP:
http://www.mycitydeal.co.uk/deals/london
There ist a counter where the time left is displayed, but the information is within the JavaScript. Since I'm really a JavaScript rookie, I didn't really know how to get the information.
Normally I would extract the information with "preg_match" and some regular expressions. Can someone help me to extract the information (Hrs., Min., Sec.) ?
Jennifer
I have some strings that need a-strippin':
ÜT: 9.996636,76.294363
Tons of long strings of location codes. A literal regex in PHP won't match them, IE
$pattern = /ÜT:/;
echo preg_replace($pattern, "", $row['location']);
Won't match/strip anything. (To know it's working, /T:/ does strip the last bit of that string). What's the encoding error going on here?
Alternately, I would accept a concise way to take out just the numbers.
Hello people,
I made a theme in WordPress which hit the mod_security rule on HostGator and gave 403 error.
I contacted people there(at HostGator) and they fixed it for me. But I don't want my theme to work like this.
I just wanted to know if there are any guides/blog post/tutorials telling about writing PHP code which is mod_security friendly?
I tried Google, but didn't find anything helpful.
Hello,
Does anyone know how to retrieve a piece of data and display the results in php file?
A similar query that I would enter is something like this:
SELECT 'email' FROM 'users' WHERE 'username' = 'bob'
Thus, the result would be just the email.
Thanks,
Kevin
Using PHP, what's the fastest way to convert a string like this: "123" to an integer?
Why is that particular method the fastest? What happens if it gets unexpected input, such as "hello" or an array?
Most of "multi-platform" CI tools I've seen are in the Java/.NET world, like TeamCity or Hudson. Is there a continuous integration tool that can handle both PHP and Rails projects?
Just wondering if there are any suitable ORBs that I can use to interconnect different tiers(presentation and business logic) in my distributed PHP multi-tier application?(both tiers are spread across different servers on the network)
Hi all, I'm trying to create a custom registration component for Joomla, and I was wondering if anyone knew how to create the correct password encryption for joomla? Joomla passwords look like this :
fbae378704687625a410223a61c66eb1:VM6DwmVWHTwpquDq51ZXjWWADCIc93MR
Which I believe are md5 (or something) and one way encryption? Am just looking for a php code of sorts to create that same encryption.
Cheers
Is strcmp() appropriate for comparing ICU collator sort keys in PHP?
The sort keys I'm asking about are from collator_get_sort_key() which are described in ICU documentation.
Hi all,
I need to download an image from some URL to my server. However, my server's config disallowed me to do it this way:
getimagesize( $file );
Because, it generate error:
Warning: getimagesize() [function.getimagesize]: URL file-access is disabled in the server configuration in somefile.php on line 10
So, is there another way I can use that doesn't require external library?
Hi,
It's possible to know if a MySQL server is overloaded (with PHP), and if it's overloaded show a static page (something like Twitter's fail whale)? How can I do it?
Thanks!