Advanced PHP Interviews Questions

Advanced PHP Interviews Questions

 Can we use include ("ABC.PHP”) two times in a PHP page “index.PHP”?

Answers: Yes we can use include("ABC.php”) more than one time in any page. but it creates a prob when xyz.php file contains some functions declaration then an error will come for already declared function in this file else not a prob like if you want to show same content two times in the page then must include it two times not a prob.

 


 

What are the different tables present in MySQL, which one is
default?


Answers : Following tables (Storage Engine) we can create
1. MyISAM(The default storage engine IN MYSQL Each MyISAM table is
stored on disk in three files. The files have names that begin with the table name
and have an extension to indicate the file type. An .frm file stores the table format.
The data file has an .MYD  extension. The index file has an .MYI
2. InnoDB(InnoDB is a transaction-safe (ACID compliant) storage engine for
MySQL that has commit, rollback, and crash recovery capabilities to protect user
data.)
3. Merge
4. Heap (MEMORY)(The MEMORY storage engine creates tables with contents
that are stored in memory. Formerly, these were known as HEAP tables. 


 

What is use of header() function in php ?

Answers :The header() function sends a raw HTTP header to a client.We can use
herder()
function for redirection of pages. It is important to notice that header() must
be called before any actual output is seen.


 How can I execute a PHP script using command line?
Answers :Just run the PHP CLI (Command Line Interface) program and
provide the PHP script file name as the command line argument.

 Suppose your Zend engine supports the mode Then how can you
configure your PHP Zend engine to support mode ?
Answers :In php.ini file:
set 
short_open_tag=on
to make PHP support


 Shopping cart online validation i.e. how can we configure Paypal, etc.?
Answers :Nothing more we have to do only redirect to the payPal url after submit
all information needed by paypal like amount,adresss etc.



 What is meant by nl2br()?

Inserts HTML line breaks (

) before all newlines in a string.

 


What is PHP Requirements?
ANS:  HTML, CSS, Javascript, Jquery, Mysql, Bootstrap, database Handling Server Manage PHP.
a web host with PHP and MySQL support
Installation a web server on your own PC, and then install PHP and MySQL



What Is the Use Of PHP?
PHP Is Used For PHP Web Development We have Created with Website Functionality Like Dynamic content, CMS, Web site Form Handling, Read Write, Open Close File, Function Module Design, Encrypt Data, Add Delete Update Fetch Data.



Why I Select Php  For Web Development?
PHP is a Wide World Language, Currently, PHP 8.0 Version Launch in 2021, Php Biggest Language For Web Development Filed, According To WWW PHP Websites In the World 60%  Website Are Used PHP Language  Backend Design.
PHP Is Very Fast other Then Languages
PHP Smart Language error Handling
PHP Easy To Connect With Other HTML, CSS, Javascript.


What Are Php String Functions?

  1. echo() Outputs one or more strings
  2. explode() Breaks a Str into an array
  3. crc32() Calculates a 32-bit CRC for a string
  4. crypt() One-way Str hashing
  5. strtolower() Converts a Str to lowercase letters
  6. strtoupper() Converts a Str to uppercase letters
  7. strtr() Translates certain characters in a string
  8. substr() Returns a part of a string
  9.  
  10. fprintf() Writes a formatted Str to a specified output stream
  11. get_html_translation_table() Returns the translation table used by htmlspecialchars() and htmlentities()
  12. htmlspecialchars() Converts some predefined characters to HTML entities
  13. implode() Returns a str from the elements of an array
  14. join() Alias of implode()
  15.  
  16.  
  17. addcslashes() The Returns a str with backslashes in front of the specified Char
  18. addslashes() Returns a str with backslashes in front of predefined Char
  19. bin2hex() Converts a str of ASCII characters to hexadecimal values
  20. chop() Removes whitespace or other characters from the right end of a string
  21. chr() Returns a character from a specified ASCII value
  22. chunk_split() Splits a str into a series of smaller parts
  23. convert_cyr_string() Converts a Str from one Cyrillic character-set to another
  24. convert_uudecode() Decodes a uuencoded string
  25. convert_uuencode() Encodes a Str using the uuencode algorithm
  26. count_chars() Returns information about characters used in a string
  27. hebrev() Converts Hebrew text to visual text
  28. hebrevc() Converts Hebrew text to visual text and new lines (\n) into
  29.  
  30. hex2bin() Converts a Str of hexadecimal values to ASCII characters
  31. html_entity_decode() Converts HTML entities to characters
  32. htmlentities() Converts characters to HTML entities
  33. htmlspecialchars_decode() Converts some predefined HTML entities to characters
  34. lcfirst() Converts the first character of a Str to lowercase
  35. levenshtein() Returns the Levenshtein distance between two strings
  36. localeconv() Returns locale numeric and monetary formatting information
  37. ltrim() Removes whitespace or other characters from the left side of a string
  38. md5() Calculates the MD5 hash of a string
  39. md5_file() Calculates the MD5 hash of a file
  40. metaphone() Calculates the metaphone key of a string
  41. money_format() Returns a Str formatted as a currency string
  42. nl_langinfo() Returns specific local information
  43. nl2br() Inserts HTML line breaks in front of each newline in a string
  44. number_format() Formats a number with grouped thousands
  45. ord() Returns the ASCII value of the first character of a string
  46. parse_str() Parses a query Str into variables
  47. print() Outputs one or more strings
  48. printf() Outputs a formatted string
  49. quoted_printable_decode() Converts a quoted-printable Str to an 8-bit string
  50. quoted_printable_encode() Converts an 8-bit Str to a quoted printable string
  51. quotemeta() Quotes meta characters
  52. rtrim() Removes whitespace or other characters from the right side of a string
  53. setlocale() Sets locale information
  54. sha1() Calculates the SHA-1 hash of a string
  55. sha1_file() Calculates the SHA-1 hash of a file
  56. similar_text() Calculates the similarity between two strings
  57. soundex() Calculates the soundex key of a string
  58. sprintf() Writes a formatted Str to a variable
  59. sscanf() Parses input from a Str according to a format
  60. str_getcsv() Parses a CSV Str into an array
  61. str_ireplace() Replaces some characters in a Str (case-insensitive)
  62. str_pad() Pads a Str to a new length
  63. str_repeat() Repeats a Str a specified number of times
  64. str_replace() Replaces some characters in a Str (case-sensitive)
  65. str_rot13() Performs the ROT13 encoding on a string
  66. str_shuffle() Randomly shuffles all characters in a string
  67. str_split() Splits a Str into an array
  68. str_word_count() Count the number of words in a string
  69. strcasecmp() Compares two strings (case-insensitive)
  70. strchr() Finds the first occurrence of a Str inside another Str (alias of strstr())
  71. strcmp() Compares two strings (case-sensitive)
  72. strcoll() Compares two strings (locale based Str comparison)
  73. strcspn() Returns the number of characters found in a Str before any part of some specified characters are found
  74. strip_tags() Strips HTML and PHP tags from a string
  75. stripcslashes() Unquotes a Str quoted with addcslashes()
  76. stripslashes() Unquotes a Str quoted with addslashes()
  77. stripos() Returns the position of the first occurrence of a Str inside another Str (case-insensitive)
  78. stristr() Finds the first occurrence of a Str inside another Str (case-insensitive)
  79. strlen() Returns the length of a string
  80. strnatcasecmp() Compares two strings using a "natural order" algorithm (case-insensitive)
  81. strnatcmp() Compares two strings using a "natural order" algorithm (case-sensitive)
  82. strncasecmp() Str comparison of the first n characters (case-insensitive)
  83. strncmp() Str comparison of the first n characters (case-sensitive)
  84. strpbrk() Searches a Str for any of a set of characters
  85. strpos() Returns the position of the first occurrence of a Str inside another Str (case-sensitive)
  86. strrchr() Finds the last occurrence of a Str inside another string
  87. strrev() Reverses a string
  88. strripos() Finds the position of the last occurrence of a Str inside another Str (case-insensitive)
  89. strrpos() Finds the position of the last occurrence of a Str inside another Str (case-sensitive)
  90. strspn() Returns the number of characters found in a Str that contains only characters from a specified charlist
  91. strstr() Finds the first occurrence of a Str inside another Str (case-sensitive)
  92. strtok() Splits a Str into smaller strings
  93. substr_compare() Compares two strings from a specified start position (binary safe and optionally case-sensitive)
  94. vprintf() Outputs a formatted string
  95. vsprintf() Writes a formatted Str to a variable
  96. wordwrap() Wraps a Str to a given number of characters
  97. substr_count() Counts the number of times a subStr occurs in a string
  98. substr_replace() Replaces a part of a Str with another string
  99. trim() Removes whitespace or other characters from both sides of a string
  100. ucfirst() Converts the first character of a Str to uppercase
  101. ucwords() Converts the first character of each word in a Str to uppercase
  102. vfprintf() Writes a formatted Str to a specified output stream

 


What are The PHP arr Functions?

  1. array() Creates an array
  2. array_change_key_case() Changes all key  in an arr to lowercase or uppercase
  3. array_chunk() Splits an arr into chunks of arrays
  4. array_column() Returns the values from a single column in the input array
  5. array_combine() Creates an arr by using the elements from one "keys" arr and one "values" array
  6. array_count_values() Counts all the values of an array
  7. array_diff() Compare arrays, and returns the differences (compare values only)
  8. array_diff_assoc() Compare arrays, and returns the differences (compare key  and values)
  9. array_diff_key() Compare arrays, and returns the differences (compare key  only)
  10. array_diff_uassoc() Compare arrays, and returns the differences (compare key  and values, using a user-defined key comparison function)
  11. array_diff_ukey() Compare arrays, and returns the differences (compare key  only, using a user-defined key comparison function)
  12. array_fill() Fills an arr with values
  13. array_fill_keys() Fills an arr with values, specifying keys
  14. array_filter() Filters the values of an arr using a callback function
  15. array_flip() Flips/Exchanges all key  with their associated values in an array
  16. array_intersect() Compare arrays, and returns the matches (compare values only)
  17. array_intersect_assoc() Compare arrays and returns the matches (compare key  and values)
  18. array_intersect_key() Compare arrays, and returns the matches (compare key  only)
  19. array_intersect_uassoc() Compare arrays, and returns the matches (compare key  and values, using a user-defined key comparison function)
  20. array_intersect_ukey() Compare arrays, and returns the matches (compare key  only, using a user-defined key comparison function)
  21. array_key_exists() Checks if the specified key exists in the array
  22. array_keys() Returns all the key  of an array
  23. array_map() Sends each value of an arr to a user-made function, which returns new values
  24. array_merge() Merges one or more arrays into one array
  25. array_merge_recursive() Merges one or more arrays into one arr recursively
  26. array_multisort() Sorts multiple or multi-dimensional arrays
  27. array_pad() Inserts a specified number of items, with a specified value, to an array
  28. array_pop() Deletes the last element of an array
  29. array_product() Calculates the product of the values in an array
  30. array_push() Inserts one or more elements to the end of an array
  31. array_rand() Returns one or more random key  from an array
  32. array_reduce() Returns an arr as a string, using a user-defined function
  33. array_replace() Replaces the values of the first arr with the values from following arrays
  34. array_replace_recursive() Replaces the values of the first arr with the values from following arrays recursively
  35. array_reverse() Returns an arr in the reverse order
  36. array_search() Searches an arr for a given value and returns the key
  37. array_shift() Removes the first element from an array, and returns the value of the removed element
  38. array_slice() Returns selected parts of an array
  39. array_splice() Removes and replaces specified elements of an array
  40. array_sum() Returns the sum of the values in an array
  41. array_udiff() Compare arrays, and returns the differences (compare values only, using a user-defined key comparison function)
  42. array_udiff_assoc() Compare arrays, and returns the differences (compare key  and values, using a built-in function to compare the key  and a user-defined function to compare the values)
  43. array_udiff_uassoc() Compare arrays, and returns the differences (compare key  and values, using two user-defined key comparison functions)
  44. array_uintersect() Compare arrays, and returns the matches (compare values only, using a user-defined key comparison function)
  45. array_uintersect_assoc() Compare arrays, and returns the matches (compare key  and values, using a built-in function to compare the key  and a user-defined function to compare the values)
  46. array_uintersect_uassoc() Compare arrays, and returns the matches (compare key  and values, using two user-defined key comparison functions)
  47. array_unique() Removes duplicate values from an array
  48. array_unshift() Adds one or more elements to the beginning of an array
  49. array_values() Returns all the values of an array
  50. array_walk() Applies a user function to every member of an array
  51. array_walk_recursive() Applies a user function recursively to every member of an array
  52. arsort() Sorts an associative arr in descending order, according to the value
  53. asort() Sorts an associative arr in ascending order, according to the value
  54. compact() Create arr containing variables and their values
  55. count() Returns the number of elements in an array
  56. current() Returns the current element in an array
  57. each() Deprecated from PHP 7.2. Returns the current key and value pair from an array
  58. end() Sets the internal pointer of an arr to its last element
  59. extract() Imports variables into the current symbol table from an array
  60. in_array() Checks if a specified value exists in an array
  61. key() Fetches a key from an array
  62. krsort() Sorts an associative arr in descending order, according to the key
  63. ksort() Sorts an associative arr in ascending order, according to the key
  64. list() Assigns variables as if they were an array
  65. natcasesort() Sorts an arr using a case insensitive "natural order" algorithm
  66. natsort() Sorts an arr using a "natural order" algorithm
  67. next() Advance the internal arr pointer of an array
  68. pos() Alias of current()
  69. prev() Rewinds the internal arr pointer
  70. range() Creates an arr containing a range of elements
  71. reset() Sets the internal pointer of an arr to its first element
  72. rsort() Sorts an indexed arr in descending order
  73. shuffle() Shuffles an array
  74. sizeof() Alias of count()
  75. sort() Sorts an indexed arr in ascending order
  76. uasort() Sorts an arr by values using a user-defined comparison function
  77. uksort() Sorts an arr by key  using a user-defined comparison function
  78. usort() Sorts an arr using a user-defined comparison function


What Are the Date Function in PHP?

  1. checkdate() Validates a Gregorian date
  2. date_add() Adds days, months, years, hours, minutes, and seconds to a date
  3. date_create_from_format() Return  a new DateTime object formatted according to a specified format
  4. date_create() Return  a new DateTime object
  5. date_date_set() Sets a new date
  6. date_default_timezone_get() Return  the default timezone used by all date/time functions
  7. date_default_timezone_set() Sets the default timezone used by all date/time functions
  8. date_diff() Return  the difference between two dates
  9. date_format() Return  a date formatted according to a specified format
  10. date_get_last_errors() Return  the warnings/errors found in a date string
  11. date_interval_create_from_date_string() Sets up a DateInterval from the relative parts of the string
  12. date_interval_format() Formats the interval
  13. date_isodate_set() Sets the ISO date
  14. date_modify() Modifies the timestamp
  15. date_offset_get() Return  the timezone offset
  16. date_parse_from_format() Return  an associative array with detailed info about a specified date, according to a specified format
  17. date_parse() Return  an associative array with detailed info about a specified date
  18. date_sub() Subtracts days, months, years, hours, minutes, and seconds from a date
  19. date_sun_info() Return  an array containing info about sunset/sunrise and twilight begin/end, for a specified day and location
  20. date_sunrise() Return  the sunrise time for a specified day and location
  21. date_sunset() Return  the sunset time for a specified day and location
  22. date_time_set() Sets the time
  23. date_timestamp_get() Return  the Unix timestamp
  24. date_timestamp_set() Sets the date and time based on a Unix  
  25. date_timezone_get() Return  the time zone of the given DateTime object
  26. date_timezone_set() Sets the time zone for the DateTime object
  27. date() Formats a local date and time
  28. getdate() Return  date/time information of a timestamp or the current local date/time
  29. gettimeofday() Return  the current time
  30. gmdate() Formats a GMT/UTC date and time
  31. gmmktime() Return  the Unix timestamp for a GMT date
  32. gmstrftime() Formats a GMT/UTC date and time according to locale settings
  33. idate() Formats a local time/date as integer
  34. localtime() Return  the local time
  35. microtime() Return  the current Unix timestamp with microseconds
  36. mktime() Return  the Unix timestamp for a date
  37. strftime() Formats a local time and/or date according to locale settings
  38. strptime() Parses a time/date generated with strftime()
  39. strtotime() Parses an English textual datetime into a Unix timestamp
  40. time() Return  the current time as a Unix timestamp
  41. timezone_abbreviations_list() Return  an associative array containing dst, offset, and the timezone name
  42. timezone_identifiers_list() Return  an indexed array with all timezone identifiers
  43. timezone_location_get() Return  location information for a specified timezone
  44. timezone_name_from_ abbr() Return  the timezone name from abbreviation
  45. timezone_name_get() Return  the name of the timezone
  46. timezone_offset_get() Return  the timezone offset from GMT
  47. timezone_open() Creates new DateTimeZone object
  48. timezone_transitions_get() Return  all transitions for the timezone
  49. timezone_version_get() Return  the version of the timezonedb

 

Most Using Functions In php?

  1. count
  2. is_array
  3. substr
  4. in_array
  5. explode
  6. str_replace
  7. implode
  8. strlen
  9. strpos
  10. preg_match
  11. sprintf
  12. trim
  13. strtolower
  14. file_exists
  15. is_string
  16. preg_replace
  17. file_get_contents
  18. array_key_exists
  19. array_keys
  20. dirname
  21. function_exists
  22. array_map
  23. get_class
  24. class_exists
  25. is_object
  26. time
  27. json_encode
  28. date
  29. is_null
  30. is_numeric
  31. array_shift
  32. defined
  33. is_dir
  34. json_decode
  35. header
  36. strtoupper
  37. array_values
  38. md5
  39. method_exists
  40. file_put_contents
  41. rtrim
  42. array_pop
  43. unlink
  44. basename
  45. realpath
  46. call_user_func
  47. call_user_func_array
  48. fopen
  49. microtime
  50. fclose
  51. is_int
  52. is_file
  53. array_slice
  54. preg_match_all
  55. intval
  56. str_repeat
  57. serialize
  58. array_filter
  59. mkdir
  60. is_callable
  61. ltrim
  62. ob_start
  63. round
  64. fwrite
  65. array_unique
  66. array_search
  67. reset
  68. array_unshift
  69. parse_url
  70. func_get_args
  71. end
  72. base64_encode
  73. unserialize
  74. max
  75. preg_split
  76. gettype
  77. strrpos
  78. version_compare
  79. array_push
  80. floor
  81. strtotime
  82. htmlspecialchars
  83. ini_get
  84. ini_set
  85. chr
  86. extension_loaded
  87. is_bool
  88. ksort
  89. array_reverse
  90. ord
  91. uniqid
  92. strtr
  93. array_diff
  94. error_reporting
  95. ceil
  96. urlencode
  97. min
  98. print_r

Admin

info@closelocation.com

I had an amazing experience at Advanced PHP Interviews Questions! The staff were friendly and attentive, creating a welcoming atmosphere. The quality of the products/services was outstanding and exceeded my expectations. If you're looking for exceptional service and a great vibe, I highly recommend visiting this place!

Related Posts

Subscribe to Newsletter!

Subscribe to get latest updates and information.

Notification