It returns current column number for an XML parser
Example
<?php
$xmlparser = xml_parser_create();
$fp = fopen(‘test.xml’, ‘r’);
while ($xmldata = fread($fp, 4096)){
if (!xml_parse($xmlparser,$xmldata,feof($fp)))
echo xml_get_current_column_number($xmlparser);
}
xml_parser_free($xmlparser);
?>
It returns current byte index for an XML parser
Example
<?php
$xmlparser = xml_parser_create();
$fp = fopen(‘test.xml’, ‘r’);
while ($xmldata = fread($fp, 4096)){
if (!xml_parse($xmlparser,$xmldata,feof($fp)))
echo xml_get_current_byte_index($xmlparser);
}
xml_parser_free($xmlparser);
?>
It returns an error string from the XML parser
Example
<?php
$xmlparser = xml_parser_create();
$fp = fopen(‘test.xml’, ‘r’);
while ($xmldata = fread($fp, 4096)){
if (!xml_parse($xmlparser,$xmldata,feof($fp)))
echo xml_error_string(xml_get_error_code($xmlparser));
}
print_r($xmldata);
xml_parser_free($xmlparser);
?>
It encodes an ISO-8859-1 string to UTF-8
Example
<?php
echo utf8_encode(“phpcodez”);
?>
It converts a string with ISO-8859-1 characters encoded with UTF-8 to single-byte ISO-8859-1
Example
<?php
echo utf8_decode(“phpcodez”);
?>
It returns the system type identifier of the remote FTP server
Example
<?php
$ftpId = ftp_connect(‘ftp.phpcodez.com’);
$login = ftp_login($ftpId, ‘anonymous’, ‘user@phpcodez.com’);
echo $type = ftp_systype($ftp) or die(“Failed”);
ftp_quit($ftpId);
?>
It opens an Secure SSL-FTP connection
Example
<?php
$ftpId = ftp_ssl_connect(‘ftp.phpcodez.com’);
$login = ftp_login($ftpId, ‘anonymous’, ‘user@phpcodez.com’);
ftp_size($ftpId, “test”) or die(“Failed”);
ftp_quit($ftpId);
?>
It returns the size of the given file
Example
<?php
$ftpId = ftp_connect(‘ftp.phpcodez.com’);
$login = ftp_login($ftpId, ‘anonymous’, ‘user@phpcodez.com’);
ftp_size($ftpId, “test”) or die(“Failed”);
ftp_quit($ftpId);
?>
It sends a SITE command to the server
Example
<?php
$ftpId = ftp_connect(‘ftp.phpcodez.com’);
$login = ftp_login($ftpId, ‘anonymous’, ‘user@phpcodez.com’);
ftp_site($ftpId, ‘CHMOD 0775 /home/user/test -R’) or die(“Failed”);
ftp_quit($ftpId);
?>
It sets miscellaneous runtime FTP options
Example
<?php
$ftpId = ftp_connect(‘ftp.phpcodez.com’);
$login = ftp_login($ftpId, ‘anonymous’, ‘user@phpcodez.com’);
ftp_set_option($ftpId, FTP_TIMEOUT_SEC, 10);
ftp_quit($ftpId);
?>
Zend | Magento Certified PHP | eCommerce Architect