I am converting a string to integer in PHP, however in the return of settype($variavel, "integer")
, or (int)$variavel
bring me a null value or equal to 1.
Is there another way to try the conversion?
The code I'm having is this:
<script type="text/html" id="javo-map-tab-infobx-content">
<div class="btn-group btn-group-justified pull-right">
<a id="botaoBrief" class="btn btn-primary btn-sm" onclick="window.javo_map_tab_func.brief_run(this);" data-id="{post_id}">
<i class="fa fa-user"></i> <?php _e("Briefaaaa", "javo_fr"); ?>
</a>
<?php
$idPost = '{post_id}';
var_dump($idPost); // resultado-> string(9) "5266"
$idPost = intval($idPost); //resultado-> 0
echo gettype($idPost); //resultado-> integer