Re: [PHP] array_walk inside class method

2002-01-22 Thread S. Murali Krishna


Dear Gyozo

You have sent me the following solution thru php mailing list.
I have also asked you a doubt  about the syntax.

I  want to explain this syntax to my colleagues, could
u
pls point me to any documentation of this syntax or any article.

if possible pls explain yourself if u have time.

It is urgent . pls 


Thanks in Advance

On Mon, 7 Jan 2002, S. Murali Krishna wrote:

 Hi
   Thanks for ur help. 
   Its Working but I couldn't understand the syntax given by u
   can u explain pls.
 
 Thanks again.
 
 
 On Sun, 6 Jan 2002, Gyozo Papp wrote:
 
  it may be better:
  
  array_walk($this-array, array($this, 'func1');
  
  | 
  | 
  |  Hi All,
  |  I want to use array_walk function inside a class method. But the
  |  problem is i want the second argument to array_walk ( function name )
  |  be a another function of the same class. when i gave like that its telling
  | 
  |  Error : function not exist.
  | 
  |  class some()
  |  {
  | 
  |  function func1()
  |  {
  |  }
  |  function func2()
  |  {
  |  array_walk($array,func1);
  |  }
  |  }
  | 
  |  What is the syntax or way to do this.
  | 
  | 
  |  Thanks in Advance.
  | 
  |  S.Murali Krishna
  |  [EMAIL PROTECTED]
  |  =
  |  We grow slow trying to be great
  | 
  | - E. Stanley Jones
  |  -
  | 
  | 
  |  --
  |  PHP General Mailing List (http://www.php.net/)
  |  To unsubscribe, e-mail: [EMAIL PROTECTED]
  |  For additional commands, e-mail: [EMAIL PROTECTED]
  |  To contact the list administrators, e-mail: [EMAIL PROTECTED]
  | 
  | 
  
 
 S.Murali Krishna
 [EMAIL PROTECTED]  
 = 
 We grow slow trying to be great
   
  - E. Stanley Jones
 -
 
 

S.Murali Krishna
[EMAIL PROTECTED]  
= 
We grow slow trying to be great

   - E. Stanley Jones
-


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] How to call Calling Non-Existing function

2002-01-21 Thread S. Murali Krishna

Thanks
This is also a quite good idea to do that. 
Thanks again. If you found some other method please mail me.


On Mon, 21 Jan 2002, val petruchek wrote:

 Not sure this is exactly what you need but try this:
 
 @Draw_Table() or default_func();
 
 
 Valentin Petruchek (aki Zliy Pes)
 http://zliypes.com.ua
 mailto:[EMAIL PROTECTED]
 - Original Message -
 From: S. Murali Krishna [EMAIL PROTECTED]
 To: PHP List [EMAIL PROTECTED]
 Sent: Monday, January 21, 2002 1:17 PM
 Subject: [PHP] How to call Calling Non-Existing function
 
 
 
  Hi PHP Experts,
 
  Is there any way to call a non-existent or undeclared function
  and redirect the call to someother function by knowing its non-existense.
 
  Is there any try() and catch() idea or any configurations,
  or may be either error handler like thing.
 
  for example if I call a function 'Draw_Table()' without declaring like
  this
 
  Draw_Table();
 
  it should know the non-existense of Draw_Table() and redirect to
  'default_func'
 
  function default_func()
  {
  
  }
 
  Note:
  
  Perl  programmers please recollect 'AUTOLOAD' Method of a package.
  C++,Java  programmers please recollect exception handling.
 
 
  Thanks in Advance.
 
  S.Murali Krishna
  [EMAIL PROTECTED]
  =
  We grow slow trying to be great
 
 - E. Stanley Jones
  -
 
 
  --
  PHP General Mailing List (http://www.php.net/)
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
  To contact the list administrators, e-mail: [EMAIL PROTECTED]
 
 
 
 
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: [EMAIL PROTECTED]
 

S.Murali Krishna
[EMAIL PROTECTED]  
= 
We grow slow trying to be great

   - E. Stanley Jones
-


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Is there Any way to call Non-Existent function in PHP

2002-01-16 Thread S. Murali Krishna

Hai ALL
Is there any way to capture function call in PHP 
and redirect to some other function if that function doesn't exists.

Perl programmers remind   AUTOLOAD method in a package.


S.Murali Krishna
[EMAIL PROTECTED]  
= 
We grow slow trying to be great

   - E. Stanley Jones
-


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Is there Any way to call Non-Existent function in PHP

2002-01-16 Thread S. Murali Krishna

Hi!
Thanks for your kind response. The solution given by u is fine.
But Iam asking just more than that. See whenever I call a function 
like 
Draw_Image();

( In language construct level )
Is there anything to checks this non-existence  of Draw_Image() and call
some default function.

I don't want to manually check if it exist or not. 

Thanks for Ur Solution.


On Wed, 16 Jan 2002, Neil Freeman wrote:

 You can use function_exists() to check whether a function actually exists:
 
 eg:
 if (function_exists('imap_open')) {
 echo IMAP functions are available.br\n;
 } else {
 echo IMAP functions are not available.br\n;
 }
 
 HTH
 
 Neil
 
 S. Murali Krishna wrote:
 
  Hai ALL
  Is there any way to capture function call in PHP
  and redirect to some other function if that function doesn't exists.
 
  Perl programmers remind   AUTOLOAD method in a package.
 
  S.Murali Krishna
  [EMAIL PROTECTED]
  =
  We grow slow trying to be great
 
 - E. Stanley Jones
  -
 
  --
  PHP General Mailing List (http://www.php.net/)
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
  To contact the list administrators, e-mail: [EMAIL PROTECTED]
 
  ***
   This message was virus checked with: SAVI 3.52
   last updated 8th January 2002
  ***
 
 --
 
  Email:  [EMAIL PROTECTED]
  [EMAIL PROTECTED]
 
 
 

S.Murali Krishna
[EMAIL PROTECTED]  
= 
We grow slow trying to be great

   - E. Stanley Jones
-


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] A Problem With Loops

2002-01-10 Thread S. Murali Krishna


Show the loop code. 


On Thu, 10 Jan 2002, Ash Young wrote:

 Hi,
 
 I am having a problem with any type of loop, for, foreach, while. I have a
 PHP script that loops through an array that contains the contents of a text
 file and processes the data it recieves.
 
 My problem is that the loop will only manage about 18 iterations before
 processing dies. I know that PHP scripts on my web host have a max 60sec
 execution time but it is not getting anywhere near that time.
 
 Any one have any ideas what I'm doing wrong?
 
 
 
 Cheers,
 
 Ash Young
 
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: [EMAIL PROTECTED]
 

S.Murali Krishna
[EMAIL PROTECTED]  
= 
We grow slow trying to be great

   - E. Stanley Jones
-


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] array_walk inside class method

2002-01-07 Thread S. Murali Krishna

Hi
Thanks for ur help. 
Its Working but I couldn't understand the syntax given by u
can u explain pls.

Thanks again.


On Sun, 6 Jan 2002, Gyozo Papp wrote:

 it may be better:
 
 array_walk($this-array, array($this, 'func1');
 
 Attila Strauss [EMAIL PROTECTED] wrote in message 
001d01c195db$67647da0$[EMAIL PROTECTED]">news:001d01c195db$67647da0$[EMAIL PROTECTED]...
 | hi
 | 
 | $this-func1();
 | 
 | 
 | best regards
 | attila
 | 
 | 
 | 
 | 
 |  Hi All,
 |  I want to use array_walk function inside a class method. But the
 |  problem is i want the second argument to array_walk ( function name )
 |  be a another function of the same class. when i gave like that its telling
 | 
 |  Error : function not exist.
 | 
 |  class some()
 |  {
 | 
 |  function func1()
 |  {
 |  }
 |  function func2()
 |  {
 |  array_walk($array,func1);
 |  }
 |  }
 | 
 |  What is the syntax or way to do this.
 | 
 | 
 |  Thanks in Advance.
 | 
 |  S.Murali Krishna
 |  [EMAIL PROTECTED]
 |  =
 |  We grow slow trying to be great
 | 
 | - E. Stanley Jones
 |  -
 | 
 | 
 |  --
 |  PHP General Mailing List (http://www.php.net/)
 |  To unsubscribe, e-mail: [EMAIL PROTECTED]
 |  For additional commands, e-mail: [EMAIL PROTECTED]
 |  To contact the list administrators, e-mail: [EMAIL PROTECTED]
 | 
 | 
 

S.Murali Krishna
[EMAIL PROTECTED]  
= 
We grow slow trying to be great

   - E. Stanley Jones
-


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] strip from html to closing body tag

2002-01-07 Thread S. Murali Krishna


Hi,
Ur quest is not clear.
Whether u want to delete everything upto body tag or only html tags
up to body tag.

anyway this might work for the former.

$parsed = preg_replace(/\\n/,,$html); // to remove  '\n' in HTML file
$parsed = preg_replace(/^(html.*)(body.*)/,\\2,$parsed);  // to
remove string upto body tag


Thanks.


On Mon, 7 Jan 2002, WB wrote:

 Hi,
 Hi i need to strip out the html up  to the body tag.
 For some reason, my function,
  preg_replace( /html(.*)body(.*) ,   , $body );
 does not work.
 Ok I am not really brilliant at regular expressions ...
 
 Help?
 
 Jay

S.Murali Krishna
[EMAIL PROTECTED]  
= 
We grow slow trying to be great

   - E. Stanley Jones
-


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] strip from html to closing body tag

2002-01-07 Thread S. Murali Krishna


Hi,
the code u sent is displaying the html as it is,
but
There is more than one way to do that.

Atmost we can atleast do this.

  $pos = strpos($html,body);
$start = substr($html,0,$pos - 1);
$html  = substr($html,$pos);
$start = preg_replace(/html/,,$start);

print $start $html ;








On Mon, 7 Jan 2002, Jimmy wrote:

 Hi WB,
 
 
  Hi i need to strip out the html up  to the body tag.
  preg_replace( /html(.*)body(.*) ,   , $body );
 
 try this:
 preg_replace( /html[^body]*body[^]*/ ,   , $body );
 
 
 --
 Jimmy
 
 Your mind is like parachute. It works best when it is open.
 
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: [EMAIL PROTECTED]
 

S.Murali Krishna
[EMAIL PROTECTED]  
= 
We grow slow trying to be great

   - E. Stanley Jones
-



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] array_walk inside class method

2002-01-05 Thread S. Murali Krishna



Hi All,
I want to use array_walk function inside a class method. But the 
problem is i want the second argument to array_walk ( function name )
be a another function of the same class. when i gave like that its telling

Error : function not exist.

class some()
{

function func1()
{
}
function func2()
{
array_walk($array,func1);
}
}

What is the syntax or way to do this.


Thanks in Advance.

S.Murali Krishna
[EMAIL PROTECTED]  
= 
We grow slow trying to be great

   - E. Stanley Jones
-


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]