[Solved] PHP print specific part of page [closed]

Use javascript’s window.print() in normal cases where javascript is enabled, and simply add a <noscript> tag to tell the user that they have to enable javascript in order to print. Something like this: <noscript>Please enable javascript in order to print the page.</noscript> 1 solved PHP print specific part of page [closed]

[Solved] Get php array from object

issues solved with the answer of @drewish Source: ReflectionClass Code: function accessProtected($obj, $prop) { $reflection = new ReflectionClass($obj); $property = $reflection->getProperty($prop); $property->setAccessible(true); return $property->getValue($obj); } solved Get php array from object

[Solved] How to debug this my Class in php

the only problem I see is the way youre accessing your method: $myLogIn = new Hos_LoginStatus(); $signedInName->getUserSignedIn(); $signedInName is not defined anywhere, it should be: $myLogIn = new Hos_LoginStatus(); $signedInName = $myLogIn->getUserSignedIn(); You should probably turn error_reporting on in order to see encountered errors. 1 solved How to debug this my Class in php

[Solved] Can’t seem to figure out this php error [closed]

In your $posts array you are missing a trailing ‘ quote, and a comma. $posts array should look like: $posts[] = array( ‘stamp’ => $data->stamp, ‘userid’ => $userid, ‘body’ => $data->body //**This is line 20.** ); Many times in PHP, when it says line 20, you should be looking at line 19. As a commenter … Read more

[Solved] Find link URL in string not image

This will do it. Short explanations on how it works can be found in the codes comments: <?php # fixed syntax error string $string = “lorem ipsum http://google.com dolor sit amet <img src=\”http://img.com/img.png\” />”; function make_clickable($text) { # explode string on spaces to array $arr = explode(‘ ‘, $text); # test each array element if … Read more

[Solved] How to setup multiple site in live server?

Sure, it works exactly the same as on local server but instead of editing hosts file you have DNS server, which can translate domains to IP adresses. Next, Apache server splits requests into domains by Host header in HTTP request. 1 solved How to setup multiple site in live server?

[Solved] input data codeigniter always 0 on database

You don’t have a valid submit button in your html code. Remove your link and use an input type “submit” or a button Replace : <div class=”form-group”> <a href=”https://stackoverflow.com/questions/29392261/<?= base_url() ?>ipmpab/addIpMpabDb/” class=”btn btn-success”> <span class=”glyphicon glyphicon-plus”></span> add </a> </div> With : <div class=”form-group”> <button type=”submit” class=”btn btn-success”> <span class=”glyphicon glyphicon-plus”></span>add </button> </div> … For exemple … Read more

[Solved] I need to get the corresponding number after * in the string

Hi is the number still part of the string ? if does, maybe you can use explode. <?php $num = “* 2 * 3 * 5”; print_r (explode(“*”,$str)); ?> I hope it helped you. 🙂 ——-UPDATED—————– $str=”first string * 2 + second string * 4 + third string * 9″; preg_match_all(‘!\d+!’, $str, $matches); print_r($matches); 5 … Read more

[Solved] How can I replace dot with comma but only for numbers in a string ? (PHP) [duplicate]

Try this one $str = “this is. an example. 15.68€”; function cleaner($matches) { return str_replace(“.” , “,” , $matches[“nrs”]); } $str = preg_replace_callback (“/(?P<nrs>[0-9]+.[0-9]+)/” , “cleaner” , $str); echo $str; I have used preg_replace_callback. The behavior of this function is almost identical to preg_replace(), except for the fact that instead of replacement parameter, one should … Read more

[Solved] How to add country flag in the html input tag? [closed]

This is what you need Only Bootstrap and Jquery can’t do that, https://github.com/mojoaxel/bootstrap-select-country/releases/tag/v3.1.0 is a Jquery Plugin to populate Select with Country name and Flag This is the full code <!DOCTYPE html> <html lang=”en”> <head> <meta charset=”UTF-8″> <meta name=”viewport” content=”width=device-width, initial-scale=1.0″> <meta http-equiv=”X-UA-Compatible” content=”ie=edge”> <title>Bootstrap Select Country</title> <link rel=”stylesheet” href=”https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.7/css/bootstrap.min.css”> <link rel=”stylesheet” href=”https://cdnjs.cloudflare.com/ajax/libs/bootstrap-select/1.12.4/css/bootstrap-select.min.css”> <link rel=”stylesheet” … Read more

[Solved] How to modify HTML inside PHP by CSS [closed]

HTML have a tag called Break 🙂 you should echo this : echo “welcome “. $row[“name”]; echo “<br />”; echo ‘<a href=”https://stackoverflow.com/questions/36248812/tran.php?page=A”><img src=”tran.png”/></a>’; solved How to modify HTML inside PHP by CSS [closed]

[Solved] PHP DateTime supported formats

As MySql have YYYY-MM-DD HH:II:SS format you can achieve it using DateTime function of PHP as $date = DateTime::createFromFormat(‘d M Y H:i:s:u’, ’13 Sep 2014 00:35:23:440′); echo $date->format(‘Y-m-d H:i:s’); DEMO 1 solved PHP DateTime supported formats