Y
Y
yumakaev2016-11-25 12:12:08
PHP
yumakaev, 2016-11-25 12:12:08

How to replace a line in a script using php?

Good day!
There is a widget from Facebook (Page), how to make the user register on the site, indicate his ID to the group during registration, throw the ID into the database, and the widget code itself, take the ID from this very database and substitute it instead of the original one?

<div class="fb-page" data-href="https://www.facebook.com/facebook" data-tabs="timeline" data-small-header="false" data-adapt-container-width="true" data-hide-cover="false" data-show-facepile="true"><blockquote cite="https://www.facebook.com/facebook" class="fb-xfbml-parse-ignore"><a href="https://www.facebook.com/facebook">Facebook</a></blockquote></div>

Answer the question

In order to leave comments, you need to log in

1 answer(s)
T
Turar Abu, 2016-11-26
@kemply

<?php
  $from    = array('%id%', '%group%', '%etc%');
  $to      = array(1, 43, 'smth');
  $str     = 'https://facebook.com/...?id=%id%&group=%group%&etc=%etc%';
  $str     = str($from, $to, $str);

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question