+

PHP Spreadsheet_Excel_Writer | SetStrikeOut () Function

Syntax:
void Format::setStrikeOut()
Parameters:this the function takes no parameters.Return value:this function returns TRUE on success and PEAR_ERROR on error.Example 1: < / strong> < tr>   require_once `Spreadsheet / Excel / Writer.php` ;  
// Create Spreadsheet_Excel_Writer object $workbook = new Spreadsheet_Excel_Writer();  
// Add worksheet $worksheet = & amp; $workbook -> addWorksheet();  
// Install Family Times New Roman font $format_times = & amp; $workbook -> addFormat(); $format_times -> setFontFamily ( `Times New Roman` );  
// Install StrikeOut $format_times -> setStrikeOut();  
// Set text shadow $format_times -> setShadow();  
// Save to sheet $worksheet -> write (0, 0, "Information" ); $worksheet -> write (1, 0, "Website Name" , $format_times ); $worksheet -> write (1, 1, "Address" , $format_times ); $worksheet -> write (2, 0, "GeeksforGeeks" ); $worksheet -> write (2, 1, " https://www.engineerforengineer.org/ " ); $workbook -> send ( `test.xls` ); $workbook -> close(); ?>
Output: Example 2: < tbody> require_once `Spreadsheet / Excel / Writer.php` ;  
// Add book $workbook = new Spreadsheet_Excel_Writer();  
// Add format to spreadsheet $format_bold = & amp; $workbook -> addFormat();  
// Set format to bold $format_bold -> setBold();  
// Install StrikeOut $format_bold -> setStrikeOut();  
// Add worksheet to Sprerdsheet $worksheet = & amp; $workbook -> addWorksheet(); $format_bold -> setBorder (2);  
// Save to sheet $worksheet -> write (0, 0, "Details of GeeksforGeeks Contributors ", $format_bold ); $worksheet -> write (1, 0, "Author" , $format_bold ); $worksheet -> write (1, 1, "User Handle" , $format_bold ); $worksheet -> write (2, 0, "Sarthak" ); $worksheet -> write (2, 1, "sarthak_ishu11" );  
// Submit the .xlsx file in the header $workbook -> send ( `test.xls` );  
// Close the book object $workbook -> close(); ?>
Output: Link : https:// pear .php.net / manual / en / package.fileformats.spreadsheet-excel-writer.spreadsheet-excel-writer-format.setstrikeout.php
Get Solution for free from DataCamp guru