From what I know about PHP, the following syntax is not legal:
if ($s == Yes)
It should instead be written as:
if ($s == 'Yes')
However, the first example is working just fine. Anyone know why?
i have studied design patterns and want to use them to code an open source library (not an application).
but i have never coded a library before and don't know where should i include files, should i have a bootstrap file that loads everything or should every class load their own classes they are dependent on etc.
are there any tutorials for writing libraries in php from start to finnish?
thanks
After I select the checkbox and press the button, the result data should display in the other page.I need to know the way I do this in php. My querry is working fine in the database and It shows the results.Now I need to display those results in the other page after selecting the first page checkbox and button(relevent to that checkbox).
I mean an interface definition without defining the return type makes it unusable?
This makes more Clear
Interface run
{
public function getInteger();
}
class MyString implements run
{
public function myNumber()
{
}
public function getInteger()
{
return "Not a number";
}
}
In Java every Interface has a return type like Integer,String,Void
I know that PHP is unfortunately a loosly typed Language but isnt there a Solution for that Problem?
Is it Possible to defining a Interface with a Return type like Integer?
hi,
what does this construct mean in PHP ? It is storing a variable called "function" with his String value in an array ?
array('function' => 'theme_select_as_checkboxes')
thanks
Can anyone tell me if its possible to validate a link with php? By validate, I mean check if the link is active and works not just the actual format of the link.
Hello,
I would like to set a cookie with PHP that has to expire at the end of the month.
How can I get the number of seconds until the end of the month?
Thank you.
What do I need to put in a php code so that the user cannot access it even if he specified the correct url for the page they are trying to access. And redirect it to the logon page. I'm really having difficulty in this matter, everytime I click back button on the browser the user can still access the page
hi all,
i m searching for a php script that download video from any video site( youtube,metacafe etc..) by submitting only url of that video.
is that possible by one script or i have to search different script for different site??
what is basic need to download video???
please reply ASAP.
thank for support me always.
I am using wordpress and I am wondering how do I get just the permalink and name of the category of a post when using:
<?php the_category() ?>
The above outputs a list and I just want to be able to wrap the permalink and category in my own markup
I am trying to use PHP to make a JSON file. Part of the code is as follow
$array = array("hello", "world");
$string='{"person": [
{
"name":'$array[0];',
"age":'$array[1];'
}
]
}';
The file created. However, $array[0] and $array[1] doesn't return the values "hello" and "world" but as $array[0] and $array[1]
Any idea?
Thanks
Hello people!
I'm a bit confused here.
I have a php array like this Array(2010,2009,2008 ...1992) and i want to create a loop to print a menu with a four year range counting down like this
2010-2006
2005-2001
2000-1996 etc..
How can i do this Everything i tried end up in an endless loop.
THnx in advance.
J.
hello
i want to create a special php and javascript page. but i want to use it into my wordpress so i want to use the exact theme that is already there in my wordpress. how to do that?
Thanks
is it possible to return findOne result as object ..or it always return an array?
i found something about mongo.objects = 1 adding to php.ini ..but did not work for me.
can some one tell me more about this?
hi,
currently i have 2 table in mysql
structure:
messages
id | content | user_id | time
submessages
id | subcontent | msg_id | user_id | time
submessages msg_id is FK for messages id.
Now i need to query from php
$cur_user = $user->current; // current user id.
SELECT * FROM messages WHERE id > '{$_GET['id']}' // problem here
how do i query submessages that posted by others not include current user?
thank you.
Hi,
Can anyone please tell if there is a simple and easy to use treeview control in php which support checkboxes?
I am looking at something that can work in IE 7 please.
I should be able to get the selected values etc.
Thanks.
I'm looking for a function that will accept a string representing the scheme portion of a URL (e.g., "http", "https", "ftp", etc.) and return the standard port. It might be used like this:
echo get_port_from_protocol("http"); // 80
As a last resort, I suppose I could write something to parse through /etc/services (assuming I only need to run under UNIX-like operating systems).
But surely there must be something built-in to PHP, no?
Hi guys.
I have :
<a href="http://abc.com">Title</a>
And :
<a href="http://xyz.com">Title</a>
I want to replace link to text "Title", but only from http://abc.com. But I don't know how ( I tried Google ), can you explain for me. I'm not good in PHP.
Thanks in advance.