Hello, how I can use array acces with my static class?
F.e. I like to execute next script:
class A {
...
}
A['p'] = 15;
echo isset(A['p']) ? A['p'] : 0;
I have a largish array of string that I want to use as a lookup.
I a using in_array(), but I suspect its doing a simple loop through - does anyone know whether the in_array() algo uses a bsearch algo?
Hey.
I was coding here the other day, writing a couple of if statements with ints that are always either zero or one (~bools), and I asked myself:
Should I use if (int == 1) or if (int != 0) ?
Is there any difference at all?
Please, don't answer with stuff regarding the int may being more/less than 1/0, that's not what I want to know.
i've got a variable $user that is of data type User (a class).
i've got it in a class method so i can't just type:
/**
* @var User
*/
$user = Factory::getInstance('User');
because that will work only with class properties, not method variables like in this case.
how could i tell netbeans that that variable is of data type User in a method?
Thanks!
I'm using this code but I can't figure out how to get the email from the user. I know you must get special permission from the user but I don't know how.
I can get the public data from the user but that's not what I even need. The only thing I need is the email.
I guess it's something with this line:
$me = $facebook->api('/me');
I have read the documentation but I still don't know how I can get the email. How do I get the email from the user loggin in on my website with the facebook api?
Okay so have a database that uses the time functions for a list of events and then displays the data as:
echo "<b>Time Frame:";
echo "$time_start"; echo " - "; echo "$time_end";
Although that displays the time as 11:00:00 if i want the time to be 11:00 am. Is there anyway to make this time display as a standard "11:00"? and also if in the mysql datababse enter it as military time (ex. 13:00) to make it display 1:00pm?
I have tried many things. Please help.
http://pastebin.com/kaTZzGrx
I have this: 2010-04-08T01:01:00Z
I want to remove the 'T' and everything behind it as well.
Also I would like to rewrite the date into this format: 08-04-2010
How can I do this the easiest way?
Thanks
I am setting up a dns lookup form using dns_get_record. I set it up to check the A Record and MX Records of the domain that is input. However, I would like it to also display the IP address of the displayed MX Records. Is this possible?
At phpro.org and other sites there is a tutorial, "Dynamic Date Time Dropdown List". How does one get the $_POST variables for insertion into a mysql database? Thanks in advance for any and all assistance.
Duplicate of http://stackoverflow.com/questions/2803425
Hello,
When a user enters his login information and hits submit, irrespective of whether the login credentials entered by the user were correct or not, i want my function to be called. In this function, i need the username entered by the user.
I think i cannot use the login op of hook_user because its called only when the user has successfully logged in.
So, how can i achieve the above functionality ?
Some sample code would be really appreciated.
Please help.
Thank You.
I have 2 MySql tables. users with id's and username's ; streams with userId's and streamId's How to get them as / join them into one table conteining only
username | streamId as SQL response? With one SQL query.
2010-June-11
<remove>2010-June-2</remove>
<remove>2010-June-3</remove>
2010-June-15
2010-June-16
2010-June-17
2010-June-3
2010-June-2
2010-June-1
I'm trying to find all instances that are between the <remove> tags
This is what I have:
$pattern = "/<remove>(.*?)<\/remove>/";
preg_match_all($pattern, $_POST['exclude'], $matches);
foreach($matches as $deselect){
foreach ($deselect as $display){
echo $display."<br />";
}
}
This is what it returns:
2010-June-2
2010-June-3
2010-June-2
2010-June-3
Why is it doubling up, and how do I prevent that?
I'm performing a query on a worksheet. I want to update the row if it exists or insert it if it doesn't. How can you check if a result was returned or not?
$query = new Zend_Gdata_Spreadsheets_ListQuery();
$query->setSpreadsheetKey($this->currKey);
$query->setWorksheetId($this->currWkshtId);
$query->setSpreadsheetQuery('cid = ' . $data['cid']);
$listFeed = $this->gdClient->getListFeed($query);
// This does not work!
if(empty($listFeed)){
echo 'No results found!';
}
I use Solr in my website, and now I am about to configure my VPS account.
I am at the stage where I need to install java in order to make Solr work.
Now, I only plan on running solr, and using it as it is (I have no java programming skills at all), so my Q is, do I need the entire JDK which includes JRE, or is JRE enough?
Thanks
BTW: My server OS is Linux (ubuntu 9.10).
Thanks
I'm trying to search multiple fields zc_city and zc_zip for when user input and then return row results for zc_city zc_state and zc_zip
$q = strtolower($_GET["q"]);
if (!$q) return;
$sql = "SELECT DISTINCT zc_city AS zcity FROM search_zipcodes WHERE zc_city LIKE '$q%'";
$rsd = mysql_query($sql);
while($rs = mysql_fetch_array($rsd)) {
$zcity = $rs['zcity'];
echo "$zcity\n";
}
If I don't know the public web directory, is there a way my script could determine the web directory, so that the script would know which directory to upload the file to?
The last time I worked with Zend_Db I recall I used to write SQL Queries manually. I've been searching for some ORM application, but, since I read something like Zend_Db is also capable of doing so, I started to try it, but I can't find neither a good tutorial explain it or a good documentation.
I read something lake Gateway pattern and ModelMapper class but I can't figure it out.
Can someone shine my path? :P
I'm trying to install imageMagick but i've got practically zero server knowledge,
i don't get what this means:
You can easily install Imagemagick on
a cPanel by using cPanel script.
/scripts/installimagemagick will do it
for you.
what is this /scripts business, where do i type it? do i type it? what's this all about?!!!
http://geobaby.in/installing-imagemagick-on-a-cpanel-server/
i am working on a webapp to download videos from streaming websites.
i don't know anything about applets but stuck here to know about them.
anybody please give basic detailed method to create such applet and how to use it?
I got this odd error and I can't figure out where it came from:
Warning: mysql_query(): 3 is not a valid MySQL-Link resource in (...)
What's up with the 3? I don't get it. Has anyone experienced this error themselves?
Hello, I have set up an array of censored words and I want to check that a user submitted comment doesn't contain any of these words. What is the most efficient way of doing this? All I've come up with so far is splitting the string into an array of words and checking it against the array of censored words, but I've a feeling there's a neater way of doing this.
I have my own server (with root access).
I need statistics of users who visit my website etc etc...
I have looked at an app called Webalyzer...
Is this a good choice?
I run apache2 on a Ubuntu 9 system...
If you know of any good statistics apps for servers please let me know.
And a follow-up question: All statistics are saved in log-files right? So how large would these log-files become then? Possibility to split them would be good, dont know if this is possible with Webalyzer though...