Jump to content
php.lv forumi

replace


anonīms

Recommended Posts

Kā varētu palaist replace, lai panāktu šādu efektu.

no:

<h3>Rekvizīti</h3>
...
<h3>Kontakti</h3>

uz

<!--<h3>Rekvizīti</h3>
...
--><h3>Kontakti</h3>

zinu, ka ar preg/str replace, bet man īsti skaidrība nav. jo visu kodu, kas ir iekšā vajag atstāt.

 

 

EDIT: ai muļķis

 

    if($account->profile_person_type == 'fiziska')
   {
   // komentējam ciet
   echo '<script>alert(1);</script>';
   $user_profile = str_replace("<h3>Rekvizīti</h3>", '<!-- <h3>Rekvizīti</h3>', $user_profile);
   $user_profile = str_replace("<h3>Kontaktinformācija</h3>", '--> <h3>Kontaktinformācija</h3>', $user_profile);
   }

Edited by anonīms
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...