Re: [PHP-DB] PHP Exercises

2008-10-31 Thread Sanjay Mantoor
Twaha,

I found PHP manual is best.
Refer http://www.php.net/manual/en/


On Fri, Oct 31, 2008 at 1:49 PM, Twaha Uddessy <[EMAIL PROTECTED]> wrote:
> Hello all,
> Iam new here,trying  hard to study PHP.Can anyone  help me  with a link where 
> I can get PHP exercises and possible solution?.
> Thank you in advance
>
>
>
>



-- 

Sanjay Mantoor

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-DB] array_filter problem with 0's

2008-07-23 Thread Sanjay Mantoor
Hi Chris,

You need to return true or false from "return_int" function.
As "0" will be treated as false it will not be returned to filtered
result array.

Change the function "return_int" like below, then you should be able
to get proper array.

function return_int($value){
  if(ctype_digit($value)){
 echo $value."\t";
  return true;
  }else{
    return false;
 }
}

Thanks,
Sanjay Mantoor

On Wed, Jul 23, 2008 at 2:31 PM, Chris <[EMAIL PROTECTED]> wrote:
> I have a string
> $num = "012 4290-2008";
> I made it an array with
>
> I tried to get the integers from the string like this.
>
> $value =  str_split($num);
> $value_new = array_filter($value, "return_int");
>
> function return_int($value){
>if(ctype_digit($value)){
>echo $value;
>return $value;
>}
> }
>
> The echo prints out all the digits including the 0.
> But the $value_new are missing the 0's.
> I would appreciate it if some one can point me in the right direction
>
> Thanks in advance
>
> Chris
>
>
> --
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>



-- 
Thanks,
Sanjay Mantoor

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php