Russel Peter video: <a rel="nofollow" href="http://www.youtube.com/watch?v=2bP9tRhJRTw">www.youtube.com/watch?v=2bP9tRhJRTw</a> russel peters video blah blah. Turtles: <a href="http://turtles.com">turtles.com</a>
I have a string that contains text and and tags with enclosed urls like the above example.
I want to str...
What's the best way to extract HTML out of $var?
example of $var
$var = "<a href="http://stackoverflow.com/">Stack Overflow</a>"
I want
$var2 = "http://stackoverflow.com/"
example: preg_match();
what else?
...
I'm looking for an efficient algorithm for detecting equal values in an array of integers N size. It must return the indices of the matches.
Alas, I can't think of anything more clever then brute force with two loops.
Any help will be appreciated.
Thanks!
...
I'm sure this is super easy, but can't seem to figure it out.. I need to select all titles from my database where the title starts with A, or B, or C etc. Here's what I've tried so far:
SELECT * FROM weblinks WHERE catid = 4 AND title LIKE 'A'
but returns nothing.. Could someone help me out with this?
Cheers
...
Hi
I have a site where I'd like to convert the first subfolder into a parameter (from a set list of subfolders), so
http://localhost/mysite/folder1/dosomething.php
is displayed as shown above, but to PHP it looks like:
... localhost/mysite/dosomething.php?organisation=folder1
I only need to do this on certain folders (i.e. not ... l...
I think this is a really, really simple question but I can't seem to find the answer.
I'm trying to set default values for properties in a PHP class and one of them is a date so I'm trying to use the date() function to set it:
<?php
class Person
{
public $fname = "";
public $lname = "";
public $bdate = date("c");
publ...
Hey guys, I am separating some XHTML from PHP by putting the XHTML into a separate file and then using PHP's include() function within the PHP script.
This works perfectly fine, however, users are still able to access the .html file directly if they know the address. They can't really do much with it, but I would rather it not show.
...
I've been trying to get my first module to work, but keep getting Fatal error: Call to undefined method JDocumentRendererModule::isTuesday() and can't for the life of me figure out what is wrong.
I think I followed all tutorials to the letter, however as I am not really comfortable with PHP, I suspect the problem really lies between the...
Hello,
please i need some help in converting a python code to a php syntax
the code is for generating an alphanumeric code using alpha encoding
the code :
def mkcpl(x):
x = ord(x)
set="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"
for c in set:
d = ord(c)^x
if chr(d) in set: ...
Hello, I am attempting to get a list of dependable(consistent across requests) list of "hidden" constants in PHP(as in, the client-side won't know about it in most cases without hacking).
Some of the things I am interested in is the following:
./configure options.
I would also like the very first System value in phpinfo.
The loaded...
When I output my MySQL Dump Regularly, it outputs a 30MB File. When I use gzip, 0KB.
Here is my code:
$command = "<path to>mysqldump --opt -h $dbhost -u$dbuser -p$dbpass $dbname | gzip> test.sql.gz";
system($command);
Result: test.sql.gz 0 KB
---------------------------
$command = "<path to>mysqldump --opt -h $dbhost -u$dbuser -p$...
I have searched everything on google and still i cant seems to find a solution for this. Basically im helping my friend to create a php frontend for his ftp.
The ftp details are saved in xml. So i have to parse it to a php.
<FileZillaServer>
<Users>
<User Name="anonymous">
<Option Name="Pass">aaaaaa</Option>
<Option Name="Group"/>
<Opt...
I know this seems like a really subjective question, but from what I'm reading, I'm generally confused. We are developing a web-based application that has tabbed windows, etc-very much a "desktop-like" application graphically. About half the page never or rarely changes, and the other half is content that could be handled dynamically w...
im using comet to push new data to the user.
1: but i wonder how i should check if new data (new messages, new replies etc) is available?
should i in the php in the background use a while loop and sleep it for 1 min so it can check every one min if new data has come in?
or should i have a trigger in the database for this?
what availa...
Can I use AuthSub with PHP ? I want to use Google API with PHP but don't want to install Zend Framework.I'm goolging and not found with AuthSub class for PHP.
...
Using Javascript (or Ajax) I want to connect to a page (a .php page) every 10 seconds. This will be done in user-side (browser) within a web page. Just, I'm trying to see the online users. I have about 1-2 visitors daily, in my personal web site.
...
Hi,
So I am trying to get the page where a visitor came from. I inserted this code into a php file and I am trying to see the page's URL but it is not working, any suggestions?
<?php
$ref = getenv("HTTP_REFERER");
echo $ref;
?>
(added this after some answers)
I have also tried
print $_SERVER["HTTP_REFERER"];
and that does...
i want to restrict certain emails to my website.
an example would be that i only want people with gmail accounts to register to my website.
{
/* Check if valid email address */
$regex = "^[_+a-z0-9-]+(\.[_+a-z0-9-]+)*"
."@[a-z0-9-]+(\.[a-z0-9-]{1,})*"
."\.([a-z]{2,}){1}$";
if(!eregi($regex,$sube...
Are there any Business Rule Engine
implemented in PHP ?
If yes, please list them.
If not, than why not, what are the
reasons behind not having Business
Rule Engine in PHP and having it in
Java ?
...
Kohana's config files look like this.. here is an example of a database config file (simplified)
return array(
'dbhost' => 'localhost',
'user' => 'Tom_Jones'
);
I've also got a CMS which wants the connection details. Whilst the CMS uses a different user (with more rights), I'd like to know the best way to include this file a...