Intereting Posts
Укладка тройных выражений Безопасное хранение HTML в базе данных без изменения кодировки символов Лучшая практика, переопределяющая __construct () по сравнению с предоставлением метода init () Zend_Db: Как подключиться к базе данных MySQL через туннель SSH? Возможно ли получить PID процесса, запущенного exec () в Windows XP? как загрузить и удалить файлы из dropzone.js SIGCHILD не обнаруживает сигнал, когда умирает детский процесс Запустите расширение chrome и отправьте данные в PHP-скрипт на загрузку страницы (автоматизируйте процесс) Буфер дополнительной информации с буфером PHP Получить идентификатор URL-адреса PHP Метод цепочки Путаница множественные входы codeigniter в таблице Во всяком случае, чтобы упростить это гнездо крыс петлей foreach? Предупреждение о безопасности PhpMyAdmin для файлов конфигурации Отправка более одного html-тега вызывает ошибку 404 в Codeigniter и Grocery Crud?

Как разбить строку из содержимого сетки и добавить элемент html

Я получил вывод из результата поиска whois как фрагмент контента, который я хочу сделать жирным шрифтом или добавить любой другой элемент HTML до «:» Sentence, а также после::

куча контента, например.

devims.com domain lookup results from whois.PublicDomainRegistry.com server: Domain Name: DEVIMS.COM Registry Domain ID: 1615408964_DOMAIN_COM-VRSN Registrar WHOIS Server: whois.publicdomainregistry.com Registrar URL: www.publicdomainregistry.com Updated Date: 2012-05-30T12:18:42Z Creation Date: 2010-09-12T14:54:29Z Registrar Registration Expiration Date: 2016-09-12T14:54:29Z Registrar: PDR Ltd. d/b/a PublicDomainRegistry.com Registrar IANA ID: 303 Registrar Abuse Contact Email: abuse-contact@publicdomainregistry.com Registrar Abuse Contact Phone: +1-2013775952 Domain Status: clientTransferProhibited (http://icann.org/epp#clientTransferProhibited) Registry Registrant ID: Registrant Name: devi sri mari Registrant Organization: devIMS Registrant Street: No.53, First Street, SS Nagar, Thirumullaivoiyal, Registrant City: Chennai Registrant State/Province: Tamil Nadu Registrant Postal Code: 600062 Registrant Country: IN Registrant Phone: +044.42839080 Registrant Phone Ext: Registrant Fax: Registrant Fax Ext: Registrant Email: devi@devims.com Registry Admin ID: Admin Name: devi sri mari Admin Organization: devIMS Admin Street: No.53, First Street, SS Nagar, Thirumullaivoiyal, Admin City: Chennai Admin State/Province: Tamil Nadu Admin Postal Code: 600062 Admin Country: IN Admin Phone: +044.42839080 Admin Phone Ext: Admin Fax: Admin Fax Ext: Admin Email: devi@devims.com Registry Tech ID: Tech Name: devi sri mari Tech Organization: devIMS Tech Street: No.53, First Street, SS Nagar, Thirumullaivoiyal, Tech City: Chennai Tech State/Province: Tamil Nadu Tech Postal Code: 600062 Tech Country: IN Tech Phone: +044.42839080 Tech Phone Ext: Tech Fax: Tech Fax Ext: Tech Email: devi@devims.com Name Server: ns743.hostgator.com Name Server: ns744.hostgator.com DNSSEC:Unsigned URL of the ICANN WHOIS Data Problem Reporting System: http://wdprs.internic.net/ >>>Last update of WHOIS database: 2015-02-11T04:42:33+0000Z<<< For more information on Whois status codes, please visit https://icann.org/epp Registration Service Provided By: HOSTMACRO WEB SERVICES The data in this whois database is provided to you for information purposes only, that is, to assist you in obtaining information about or related to a domain name registration record. We make this information available "as is", and do not guarantee its accuracy. By submitting a whois query, you agree that you will use this data only for lawful purposes and that, under no circumstances will you use this data to: (1) enable high volume, automated, electronic processes that stress or load this whois database system providing you this information; or (2) allow, enable, or otherwise support the transmission of mass unsolicited, commercial advertising or solicitations via direct mail, electronic mail, or by telephone. The compilation, repackaging, dissemination or other use of this data is expressly prohibited without prior written consent from us. The Registrar of record is PDR Ltd. d/b/a PublicDomainRegistry.com. We reserve the right to modify these terms at any time. By submitting this query, you agree to abide by these terms 

ожидаемый вывод в html

 eg. <li>Registrar WHOIS Server</li>: <li>whois.publicdomainregistry.com </li> or eg. <b>Registrar WHOIS Server</b>: <li>whois.publicdomainregistry.com </li> eg. <li>Registrar WHOIS Server</li>: <li>whois.publicdomainregistry.com </li> or eg. <b>Registrar WHOIS Server:</b> <li>whois.publicdomainregistry.com </li> 

Что я пробовал: My Code

  $result = "Registrar WHOIS Server: whois.publicdomainregistry.com Registrar URL: www.publicdomainregistry.com Updated Date: 2012-05-30T12:18:42Z Creation Date: 2010-09-12T14:54:29Z Registrar Registration Expiration Date: 2016-09-12T14:54:29Z Registrar: PDR Ltd. d/b/a PublicDomainRegistry.com Registrar IANA ID: 303 Registrar Abuse Contact Email: abuse-contact@publicdomainregistry.com Registrar Abuse Contact Phone: +1-2013775952 Domain Status: clientTransferProhibited (http://icann.org/epp#clientTransferProhibited) Registry Registrant ID: Registrant Name: devi sri mari Registrant Organization: devIMS Registrant Street: No.53, First Street, SS Nagar, Thirumullaivoiyal, Registrant City: Chennai Registrant State/Province: Tamil Nadu Registrant Postal Code: 600062 Registrant Country: IN Registrant Phone: +044.42839080 Registrant Phone Ext: Registrant Fax: Registrant Fax Ext: Registrant Email: devi@devims.com"; echo $result; $res = explode( ': ', $result ); foreach ($res as $value) { echo '<li>'. $value .'</li>'; } print_r( explode( ': ', $result ) ); 

Вывод

  Array ( [0] => Registrar WHOIS Server [1] => whois.publicdomainregistry.com Registrar URL [2] => www.publicdomainregistry.com Updated Date [3] => 2012-05-30T12:18:42Z Creation Date [4] => 2010-09-12T14:54:29Z Registrar Registration Expiration Date [5] => 2016-09-12T14:54:29Z Registrar [6] => PDR Ltd. d/b/a PublicDomainRegistry.com Registrar IANA ID [7] => 303 Registrar Abuse Contact Email [8] => abuse-contact@publicdomainregistry.com Registrar Abuse Contact Phone [9] => +1-2013775952 Domain Status [10] => clientTransferProhibited (http://icann.org/epp#clientTransferProhibited) Registry Registrant ID [11] => Registrant Name [12] => devi sri mari Registrant Organization [13] => devIMS Registrant Street [14] => No.53, First Street, SS Nagar, Thirumullaivoiyal, Registrant City [15] => Chennai Registrant State/Province [16] => Tamil Nadu Registrant Postal Code [17] => 600062 Registrant Country [18] => IN Registrant Phone [19] => +044.42839080 Registrant Phone Ext [20] => Registrant Fax [21] => Registrant Fax Ext [22] => Registrant Email [23] => devi@devims.com ) 

ожидаемый результат

  Array ( [0] => Registrar WHOIS Server [1] => whois.publicdomainregistry.com [2] => Registrar URL [3] => www.publicdomainregistry.com [4] => Updated Date [5] => 2012-05-30T12:18:42Z [6] => reation Date [7] => 2010-09-12T14:54:29Z [8] => Registrar Registration Expiration Date [9] => 2016-09-12T14:54:29Z [10] => Registrar URL [11] => PDR Ltd. d/b/a PublicDomainRegistry.com [12] => Registrar IANA ID .... )