05.05.2013 Views

Programming PHP

Programming PHP

Programming PHP

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

strcmp<br />

int strcmp(string one, string two)<br />

Compares two strings; returns a number less than 0 if one is less than two, 0 if the two<br />

strings are equal, and a number greater than 0 if one is greater than two. The comparison is<br />

case-sensitive—that is, “Alphabet” and “alphabet” are not considered equal.<br />

strcoll<br />

int strcoll(string one, string two)<br />

Compares two strings using the rules of the current locale; returns a number less than 0 if<br />

one is less than two, 0 if the two strings are equal, and a number greater than 0 if one is<br />

greater than two. The comparison is case-sensitive—that is, “Alphabet” and “alphabet” are<br />

not considered equal.<br />

strcspn<br />

int strcspn(string string, string characters)<br />

Returns the position of the first instance of a character from characters in string.<br />

strftime<br />

string strftime(string format[, int timestamp])<br />

Formats a time and date according to the format string provided in the first parameter and<br />

the current locale. If the second parameter is not specified, the current time and date is<br />

used. The following characters are recognized in the format string:<br />

%a Name of the day of the week as a three-letter abbreviation; e.g., “Mon”<br />

%A Name of the day of the week; e.g., “Monday”<br />

%b Name of the month as a three-letter abbreviation; e.g., “Aug”<br />

%B Name of the month; e.g., “August”<br />

%c Date and time in the preferred format for the current locale<br />

%C The last two digits of the century<br />

%d Day of the month as two digits, including a leading zero if necessary; e.g.,<br />

“01” through “31”<br />

%D Same as %m/%d/%y<br />

%e Day of the month as two digits, including a leading space if necessary; e.g.,<br />

“1” through “31”<br />

%h Same as %b<br />

This is the Title of the Book, eMatter Edition<br />

Copyright © 2002 O’Reilly & Associates, Inc. All rights reserved.<br />

strftime | 445

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!