php if like ? :

[php] if(x==y){ $z=0; }else{ $z=1; } [/php] example : [php] $z=(x=y ? 0 : 1 ); [/php]

14/01/2015

Php pathinfo() function

[php] <?php print(__FILE__); echo '<br>'; echo'PATHINFO_DIRNAME: '. pathinfo(__FILE__, PATHINFO_DIRNAME); echo '<br>'; echo'PATHINFO_BASENAME: '. pathinfo(__FILE__, PATHINFO_BASENAME); echo '<br>'; echo'PATHINFO_EXTENSION: '. pathinfo(__FILE__, PATHINFO_EXTENSION); echo '<br>'; ?> [/php] => visual is below /home/natural/public_html/dd/dd.php PATHINFO_DIRNAME: /home/natural/public_html/dd PATHINFO_BASENAME: dd.php PATHINFO_EXTENSION: php

14/01/2015

Php Regular Expressions

Regular ExpressionWill match...
fooThe string "foo"
^foo"foo" at the start of a string
foo$"foo" at the end of a string
^foo$"foo" when it is alone on a string
[abc]a, b, or c
[a-z]Any lowercase letter
[^A-Z]Any character that is not a uppercase letter
(gif|jpg)Matches either "gif" or "jpeg"
[a-z]+One or more lowercase letters
[0-9\.\-]?ny number, dot, or minus sign
^[a-zA-Z0-9_]{1,}$Any word of at least one letter, number or _
([wx])([yz])wy, wz, xy, or xz
[^A-Za-z0-9]Any symbol (not a number or a letter)
([A-Z]{3}|[0-9]{4})Matches three letters or four numbers



Regular Expressions Reference Sheet

CharacterDefinitionExample

^

The pattern has to appear at the beginning of a string.^cat matches any string that begins with cat

$

The pattern has to appear at the end of a string.cat$ matches any string that ends with cat

.

Matches any character.cat. matches catT and cat2 but notcatty

[]

Bracket expression. Matches one of any characters enclosed.gr[ae]y matches gray or grey

[^]

Negates a bracket expression. Matches one of any characters EXCEPT those enclosed.1[^02] matches 13 but not 10 or12

[-]

Range. Matches any characters within the range.[1-9] matches any single digit EXCEPT 0

?

Preceeding item must match one or zero times.colou?r matches color or colour but not colouur

+

Preceeding item must match one or more times.be+ matches be or bee but not b

*

Preceeding item must match zero or more times.be* matches b or be orbeeeeeeeeee

()

Parentheses. Creates a substring or item that metacharacters can be applied toa(bee)?t matches at or abeet but not abet

{n}

Bound. Specifies exact number of times for the preceeding item to match.[0-9]{3} matches any three digits

{n,}

Bound. Specifies minimum number of times for the preceeding item to match.[0-9]{3,} matches any three or more digits

{n,m}

Bound. Specifies minimum and maximum number of times for the preceeding item to match.[0-9]{3,5} matches any three, four, or five digits

|

Alternation. One of the alternatives has to match.July (first|1st|1) will match July 1stbut not July 2

POSIX Character Classes

CharacterDefinitionExample

[:alnum:]

alphanumeric character[[:alnum:]]{3} matches any three letters or numbers, like 7Ds

[:alpha:]

alphabetic character, any case[[:alpha:]]{5} matches five alphabetic characters, any case, like aBcDe

[:blank:]

space and tab[[:blank:]]{3,5} matches any three, four, or five spaces and tabs

[:digit:]

digits[[:digit:]]{3,5} matches any three, four, or five digits, like 3, 05, 489

[:lower:]

lowercase alphabetics[[:lower:]] matches a but not A

[:punct:]

punctuation characters[[:punct:]] matches ! or . or , but not a or 3

[:space:]

all whitespace characters, including newline and carriage return[[:space:]] matches any space, tab, newline, or carriage return

[:upper:]

uppercase alphabetics[[:upper:]] matches A but not a

Perl-Style Metacharacters

CharacterDefinitionExample

//

Default delimiters for pattern/colou?r/ matches color or colour

i

Append to pattern to specify a case insensitive match/colou?r/i matches COLOR orColour

\b

A word boundary, the spot between word (\w)and non-word (\W) characters/\bfred\b/i matches Fred but notAlfred or Frederick

\B

A non-word boundary/fred\B/i matches Frederick but notFred

\d

A single digit character/a\db/i matches a2b but not acb

\D

A single non-digit character/a\Db/i matches aCb but not a2b

\n

The newline character. (ASCII 10)/\n/ matches a newline

\r

The carriage return character. (ASCII 13)/\r/ matches a carriage return

\s

A single whitespace character/a\sb/ matches a b but not ab

\S

A single non-whitespace character/a\Sb/ matches a2b but not a b

\t

The tab character. (ASCII 9)/\t/ matches a tab.

\w

A single word character - alphanumeric and underscore/\w/ matches 1 or _ but not ?

\W

A single non-word character/a\Wb/i matches a!b but not a2b



14/01/2015

PHPExcel - Formating cell and Number Format

PHPExcel - Formating cell and Number Format

PHPExcel - Formating cell and Number Format  css formating


14/01/2015

Php $_SERVER some key value

[php] <?php $_SERVER["QUERY_STRING"] // index.php?x=1&y=2 $_SERVER["REMOTE_ADDR"] // client ip $_SERVER["HTTP_REFERER"] // http://domain.com/blog/category/11 $_SERVER["REQUEST_URI"] // /blog/category/11 $_SERVER["SCRIPT_NAME"] // index.php $_SERVER["SERVER_NAME"] // domain.com $_SERVER["HTTP_HOST"] // domain.com $_SERVER["DOCUMENT_ROOT"] // /home/username/public_html ?> [/php]

14/01/2015

php array function list

  • in_array  — Checks if a value exists in an array  return True or False
  • array_search:  Searches the array for a given value and returns the corresponding key if successful
  • array_combine : Creates an array by using one array for keys and another for its values
  • The array_slice() function returns selected parts of an array.
  • array_merge — Merge one or more arrays
  • array_sum — Calculate the sum of values in an array
 
  • list — Assign variables as if they were an array
  • call_user_func — Call the callback given by the first paramet
  • call_user_func_array — Call a callback with an array of parameters
  • array_intersect_key
in_array  — Checks if a value exists in an array  return True or False no example array_search:  Searches the array for a given value and returns the corresponding key if successful Example: [php]<!--?php $array = array(0 =--> 'blue', 1 => 'red', 2 => 'green', 3 => 'red'); $key = array_search('green', $array); // $key = 2; $key = array_search('red', $array);   // $key = 1; ?> [/php] array_combine : Creates an array by using one array for keys and another for its values Example: [php] <!--?php $a = array('green', 'red', 'yellow'); $b = array('avocado', 'apple', 'banana'); $c = array_combine($a, $b); print_r($c); ?--> [/php] The array_slice() function returns selected parts of an array. [php]</pre> &nbsp; <!--?php $input = array("a", "b", "c", "d", "e"); $output = array_slice($input, 2);      // returns "c", "d", and "e" $output = array_slice($input, -2, 1);  // returns "d" $output = array_slice($input, 0, 3);   // returns "a", "b", and "c" // note the differences in the array keys print_r(array_slice($input, 2, -1)); print_r(array_slice($input, 2, -1, true)); ?-->&nbsp; <pre>[/php] Output: Array ( [0] => c [1] => d ) Array ( [2] => c [3] => d ) list — Assign variables as if they were an array [php]<!--?php list($a, list($b, $c)) = array(1, array(2, 3)); var_dump($a, $b, $c); ?--> [/php] end — Set the internal pointer of an array to its last element [php] <!--?php $fruits = array('apple', 'banana', 'cranberry'); echo end($fruits); // cranberry ?--> [/php]

14/01/2015

how to keep lates jquery between head tags

<script type="text/javascript" src="http://code.jquery.com/jquery-latest.js"></script>


14/01/2015

a list of jquery function

[code lang="js"]$("span").text(arr.join(", ")); .change(); $("div:contains('John')").css("text-decoration", "underline"); $("div").slideDown("slow"); $("div").slideUp(); $('li').not(':even').css('background-color', 'red'); $('li.item-a').parent().css('background-color', 'red'); $(this).css("border", "2px red inset").filter(".middle").css("background", "yellow").focus(); $("div").css("background", "#b4b0da").filter(function (index) { return index == 1 || $(this).attr("id") == "fourth"; }) .css("border", "3px double red");</pre> [/code]

14/01/2015

My Task Page

My Task Page


17/03/2014

User Boards

User Boards


16/03/2014

Setting Smtp

Setting Smtp  page  : admin/site_settings


15/03/2014

Task Projects

projects


14/03/2014

Task User Group

unlimited task user group


14/03/2014

Task Logs

  • Task logs

14/03/2014

Task Discussions

  • Task Discussions

14/03/2014

File Manager

File Manager 


14/03/2014

Mail Notifications

Mail Notifications


14/03/2014

What Does The Conflict Means In Task Management ?

It is conflict beetween developer and tester while the task disapproved by testter number of conflict increase 1 each time.


14/03/2014

Task Filter List

Main Task Filter List 


10/03/2014

General Website Settings

General Settings


10/03/2014

Project Settings

 Project  general Settings


10/03/2014