After upgrade to PHP 5.3 my application is returning DB2 columns with Timestamp type as "2010-12-15-10.23.22.716000".
This is causing problem for PHP DateTime function, as it fails with
Failed to parse time string (2010-12-15-10.23.22.716000) at position 25 (0): Unexpected character
It seems its having a problem with too much accuracy in DB2 timestamp.
Can I somehow force connection to change timestamp format with it is fetching data into?
I have some xml files with figure spaces in it, I need to remove those with php.
The utf-8 code for these is e2 80 a9. If I'm not mistaken php does not seem to like 6 byte utf-8 chars, so far at least I'm unable to find a way to delete the figure spaces with functions like preg_replace.
Anybody any tips or even better a solution to this problem?
Hi,
I often come across some nice web sites and I want to know what technologies (PHP, JSP, ASP.NET, etc) are used to build those web sites.
The web address of some web sites end with ".aspx", ".php", ".jsp", etc. But some web address do not contains any indicators.
Is there any systematic way we can use to know the technologies used by a web site?
Thanks.
I would expect this option to exist in PHP - Editor - Save Actions but the only thing available there is to "remove trailing whitespace"...
It's available in JavaScript - Editor - Save Actions but not php :(
Is there a plugin that will let me do this?
Hi...
I need help because I don't know about web services using php
somebody help me
I need to create a web services with php and I need some any reference (free)
Thanks for your help
How to replace space and dash coming together with only dash in php
e.g below is my url
[url] = http://kjd.case.150/1 BHK+Balcony- 700+ sqft. spacious apartmetn Bandra West
In this I want to replace all special characters with dash in php.In url there is already 1 dash after balcony.If i m replacing dash with special chars then it becomes two dash bcoz already there is 1 dash in url and i want only 1 dash.
I'm looking for a random number generator that I can run in PHP, C and Java that will always return the same sequence of numbers for a given seed.
Here's the Java implementation I would use: java.util.random source
Whilst this would be fairly straightforward to port to C and PHP, there is potentially a lot of work to get all the edge cases correct and handle differences in number representation. I'd be extremely happy to just copy and paste a fully tested version should it exist.
my code-
<?php
session_start();
$_SESSION['errors']="failed";
?>
<head>
function myfunc()
{
alert(<?php echo $_SESSION['errors']; ?>);
}
</head>
<body onload="myfunc();">
but alert msg is not popping up.
Hello everybody,
I want to convert a pdf file to an image with PHP, but i can't get the command worked. PHP returns a 4. I don't have any kind of idea what that can be.
I am using the next code:
$tmp = system("convert -version", $value);
var_dump($value);
Someone an idea?
I'm writing a simple linear linked list implementation in PHP. This is basically just for practice... part of a Project Euler problem. I'm not sure if I should be using unset() to help in garbage collection in order to avoid memory leaks. Should I include an unset() for head and temp in the destructor of LLL?
I understand that I'll use unset() to delete nodes when I want, but is unset() necessary for general clean up at any point?
Is the memory map freed once the script terminates even if you don't use unset()?
I saw this SO question, but I'm still a little unclear. Is the answer that you simply don't have to use unset() to avoid any sort of memory leaks associated with creating references?
I'm using PHP 5.. btw.
Unsetting references in PHPPHP references tutorial
Here is the code - I'm creating references when I create $temp and $this-head at certain points in the LLL class:
class Node
{
public $data;
public $next;
}
class LLL
{
// The first node
private $head;
public function __construct()
{
$this->head = NULL;
}
public function insertFirst($data)
{
if (!$this->head)
{
// Create the head
$this->head = new Node;
$temp =& $this->head;
$temp->data = $data;
$temp->next = NULL;
} else
{
// Add a node, and make it the new head.
$temp = new Node;
$temp->next = $this->head;
$temp->data = $data;
$this->head =& $temp;
}
}
public function showAll()
{
echo "The linear linked list:<br/> ";
if ($this->head)
{
$temp =& $this->head;
do
{
echo $temp->data . " ";
} while ($temp =& $temp->next);
} else
{
echo "is empty.";
}
echo "<br/>";
}
}
Thanks!
Hi,
I want to have an array of struct (an array of books with their specifications like publication, ISBN number, ...). in wsdl and php. I have searched a little and I have found files that uses Nusoap, However, I dont want to use NuSoap. Is there any solution? I would appreciate if you help me in writing the related wsdl, client and server (php) files.
Thank you so much.
Best, shadi.
I'm not sure what to call this, so I'll give an example.
In PHP
1==2 || 2 returns 1 or true
In Ruby
1==2 || 2 returns 2 (The second statement if the first evaluates to false).
Is there any short way to implement similar thing in PHP?
I would like to name my css file mystyles.php. All content within will still be css. I'd like to then include this into my index.php page without using the standard HTML <link> tag. Any direction would be appreciated very much.
i have created a file with extention .php.so how should i run this file with netbeans.i have download the netbeans 6.8 with all bundle feature.i hav seen the php file can run with netbeans so i m asking.plz explain
Is there anyway invoke a PHP page / function when a record being inserted in to the mysql db table. We dont have control over the record insertion procedure.Is there some thing called trigger which can call a PHP script back ?
I am sending login status = fail, back to my login page.Here is my code-
header("location:index.php?login=fail");
but that is sending through URL like-
http://localhost/303/index.php?login=fail
is there any way to pass value without showing in URL? And how to get this value on the second page?
Is this iteration the best?
(Pi^2)/12 = 1 - 1/4 + 1/9 - 1/16 + 1/25 etc.
-For converging faster?
If not please answer with the iteration -preferably in the form above (an example) -not a splat of algebra ...
I'm doing this to find Pi to 1,000,000,000 places online.
http://www.zombiewrath.com/superpi.php
or my 10,000 one:
http://www.zombiewrath.com/pi.php
Hi.
I want to retrieve all hashtags from a tweet using a PHP function.
I know someone asked a similar question here, but there is no hint how exactly to implement this in PHP. Since I'm not very familiar with regular expressions, don't know how to write a function that returns an array of all hashtags in a tweet.
So how do I do this, using the following regular expression:
#\S*\w
I have the array variable say $value, and it has the below given array
[navigation] => navigationHistory Object
(
[path] => Array
(
[0] => Array
(
[page] => order_form.php
[mode] => NONSSL
[get] => Array
(
[id] => 31
)
)
)
)
how to echo/access the 'get' index of the given array in PHP syntax
I am working on an example from a php book and am getting an error on line 8 with this code
<?php
$agent = getenv("HTTP_USER_AGENT");
if (preg_match("/MSIE/i", "$agent"));
{
$result = "You are using Microsoft Internet Explorer";
}
else if (preg_match("/Mozilla/i", "$agent"));
{
$result = "You are using Mozilla firefox";
}
else {$result = "you are using $agent"; }
echo $result;
?>
I've got a simple login system using PHP sessions, but just recently it seems that if you visit pages not in a certain directory (/login/) you will always be flagged as not logged in, even when you are. It seems that my session data is being lost when I change directories (say, to /login/user/).
I don't think I've touched the code myself since the problem appeared, is there something my web host could have done to my PHP installation that would delete the session data, and is there a workaround?