Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [PHP]Wyrażenie regularne - błędne wyłapanie wartości
Elber
post
Post #1





Grupa: Zarejestrowani
Postów: 381
Pomógł: 12
Dołączył: 9.07.2007

Ostrzeżenie: (0%)
-----


witam,

mam ciąg

  1. $this->_headerText = Mage::helper('productstable')->__('Products Table').Mage::helper('productstable')->__('Add Products Table');


i chcę wyłapać tylko to co jest w __('')

gdy wykonuje

  1. preg_match_all("/__\('(.+)'\)?/", $file, $string);


skrypt zwraca mi

  1. Products Table'),Mage::helper('productstable')->__('Add Products Table


jeśli ciąg dam do nowej linii to jest ok, problem tylko z tym gdy jest w 1 linii.
Go to the top of the page
+Quote Post
 
Start new topic
Odpowiedzi
Elber
post
Post #2





Grupa: Zarejestrowani
Postów: 381
Pomógł: 12
Dołączył: 9.07.2007

Ostrzeżenie: (0%)
-----


No właśnie nie bo teraz mamy 2 przypadki

1.
  1. __('Products Table')

2.

  1. __("Add Products Table", $dsacsada)
Go to the top of the page
+Quote Post

Posty w temacie


Reply to this topicStart new topic
2 Użytkowników czyta ten temat (2 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Aktualny czas: 11.10.2025 - 09:09